Disambiguate updatemanager restart overloads

This commit is contained in:
Caelan Sayler
2024-02-15 08:31:26 +00:00
parent bcdcbb4cda
commit 651f098aae
4 changed files with 10 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ public partial class MainWindow : Window
private void BtnRestartApplyClick(object sender, RoutedEventArgs e)
{
_um.ApplyUpdatesAndRestart();
_um.ApplyUpdatesAndRestart(_update);
}
private void LogUpdated(object sender, LogUpdatedEventArgs e)

View File

@@ -45,7 +45,7 @@ namespace VeloWpfSample
private void BtnRestartApplyClick(object sender, RoutedEventArgs e)
{
_um.ApplyUpdatesAndRestart();
_um.ApplyUpdatesAndRestart(_update);
}
private void LogUpdated(object sender, LogUpdatedEventArgs e)

View File

@@ -39,5 +39,10 @@
BaseRelease = deltaBaseRelease;
DeltasToTarget = deltasToTarget ?? new VelopackAsset[0];
}
/// <summary>
/// Implicitly convert an <see cref="UpdateInfo"/> to a <see cref="VelopackAsset"/>.
/// </summary>
public static implicit operator VelopackAsset(UpdateInfo updateInfo) => updateInfo.TargetFullRelease;
}
}

View File

@@ -9,11 +9,7 @@ namespace Velopack
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use one of the other overloads of ApplyUpdatesAndRestart() instead.")]
public void ApplyUpdatesAndRestart(string[]? restartArgs = null)
=> ApplyUpdatesAndRestart((VelopackAsset?) null, restartArgs);
/// <inheritdoc cref="ApplyUpdatesAndRestart(VelopackAsset, string[])"/>
public void ApplyUpdatesAndRestart(UpdateInfo? toApply, string[]? restartArgs = null)
=> ApplyUpdatesAndRestart(toApply?.TargetFullRelease, restartArgs);
=> ApplyUpdatesAndRestart(null, restartArgs);
/// <summary>
/// This will exit your app immediately, apply updates, and then optionally relaunch the app using the specified
@@ -32,12 +28,8 @@ namespace Velopack
/// <inheritdoc cref="ApplyUpdatesAndExit(VelopackAsset)"/>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Please use one of the other overloads of ApplyUpdatesAndExit() instead.")]
public void ApplyUpdatesAndExit(string[]? restartArgs = null)
=> ApplyUpdatesAndExit((VelopackAsset?) null);
/// <inheritdoc cref="ApplyUpdatesAndExit(VelopackAsset)"/>
public void ApplyUpdatesAndExit(UpdateInfo? toApply)
=> ApplyUpdatesAndExit(toApply?.TargetFullRelease);
public void ApplyUpdatesAndExit()
=> ApplyUpdatesAndExit(null);
/// <summary>
/// This will exit your app immediately, apply updates, and then optionally relaunch the app using the specified