mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add new restart api
This commit is contained in:
parent
484f91c52d
commit
7611b00287
2 changed files with 10 additions and 3 deletions
|
|
@ -33,6 +33,12 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
void RestartApp();
|
||||
|
||||
/// <summary>
|
||||
/// Restart Flow Launcher with arguments
|
||||
/// </summary>
|
||||
/// <param name="arguments">Application start arguments</param>
|
||||
void RestartApp(string arguments);
|
||||
|
||||
/// <summary>
|
||||
/// Run a shell command
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ using System.Runtime.CompilerServices;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
using Flow.Launcher.Core;
|
||||
|
|
@ -73,8 +72,10 @@ namespace Flow.Launcher
|
|||
_mainVM.ChangeQueryText(query, requery);
|
||||
}
|
||||
|
||||
public void RestartApp() => RestartApp(null);
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
|
||||
public async void RestartApp()
|
||||
public async void RestartApp(string arguments)
|
||||
{
|
||||
_mainVM.Hide();
|
||||
|
||||
|
|
@ -89,7 +90,7 @@ namespace Flow.Launcher
|
|||
// Restart requires Squirrel's Update.exe to be present in the parent folder,
|
||||
// it is only published from the project's release pipeline. When debugging without it,
|
||||
// the project may not restart or just terminates. This is expected.
|
||||
UpdateManager.RestartApp(Constant.ApplicationFileName);
|
||||
UpdateManager.RestartApp(Constant.ApplicationFileName, arguments);
|
||||
}
|
||||
|
||||
public void ShowMainWindow() => _mainVM.Show();
|
||||
|
|
|
|||
Loading…
Reference in a new issue