mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Use ShellRun to provide unified experience
This commit is contained in:
@@ -506,6 +506,21 @@ namespace Wox
|
||||
|
||||
#endregion
|
||||
|
||||
public bool ShellRun(string cmd)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(cmd))
|
||||
throw new ArgumentNullException();
|
||||
|
||||
Wox.Infrastructure.WindowsShellRun.Start(cmd);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowMsg("Could not start " + cmd, ex.Message, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ namespace Wox.PluginLoader
|
||||
})),
|
||||
StartLoadingBar = () => App.Window.Dispatcher.Invoke(new Action(() => App.Window.StartLoadingBar())),
|
||||
StopLoadingBar = () => App.Window.Dispatcher.Invoke(new Action(() => App.Window.StopLoadingBar())),
|
||||
ShellRun = (cmd) => (bool) App.Window.Dispatcher.Invoke(new Func<bool>(() => App.Window.ShellRun(cmd))),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user