mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Fix Wox restart
1. refactoring restart 2. delte some windows forms methods 3. using string inteperlation and delete hard coeded new line char should fix #322
This commit is contained in:
@@ -10,7 +10,6 @@ using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Animation;
|
||||
using NHotkey;
|
||||
@@ -26,14 +25,10 @@ using Wox.Infrastructure.Hotkey;
|
||||
using Wox.Plugin;
|
||||
using Wox.Storage;
|
||||
using ContextMenu = System.Windows.Forms.ContextMenu;
|
||||
using DataFormats = System.Windows.DataFormats;
|
||||
using DragEventArgs = System.Windows.DragEventArgs;
|
||||
using IDataObject = System.Windows.IDataObject;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
using NotifyIcon = System.Windows.Forms.NotifyIcon;
|
||||
using Screen = System.Windows.Forms.Screen;
|
||||
using MenuItem = System.Windows.Forms.MenuItem;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using Stopwatch = Wox.Infrastructure.Stopwatch;
|
||||
using ToolTip = System.Windows.Controls.ToolTip;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
@@ -93,6 +88,16 @@ namespace Wox
|
||||
}));
|
||||
}
|
||||
|
||||
public void RestarApp()
|
||||
{
|
||||
ProcessStartInfo info = new ProcessStartInfo
|
||||
{
|
||||
FileName = Application.ResourceAssembly.Location,
|
||||
Arguments = SingleInstance<App>.Restart
|
||||
};
|
||||
Process.Start(info);
|
||||
}
|
||||
|
||||
public void HideApp()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(HideWox));
|
||||
|
||||
Reference in New Issue
Block a user