common helper for execute shell process from run plugins (#9538)

This commit is contained in:
Davide Giacometti
2021-02-23 09:53:08 +01:00
committed by GitHub
parent 20a922ce21
commit 571bceb386
17 changed files with 77 additions and 128 deletions

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Abstractions;
@@ -12,9 +11,7 @@ using System.Text;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using PowerLauncher.Helper;
using Wox.Infrastructure;
using Wox.Infrastructure.Image;
using Wox.Plugin.Logger;
@@ -83,12 +80,8 @@ namespace PowerLauncher
private void RepositoryHyperlink_Click(object sender, RoutedEventArgs e)
{
var ps = new ProcessStartInfo((sender as Hyperlink).NavigateUri.ToString())
{
UseShellExecute = true,
Verb = "open",
};
Process.Start(ps);
var uri = (sender as Hyperlink).NavigateUri.ToString();
Wox.Infrastructure.Helper.OpenInShell(uri);
}
}
}

View File

@@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
@@ -240,11 +239,6 @@ namespace PowerLauncher.ViewModel
SelectFirstResultCommand = new RelayCommand(_ => SelectedResults.SelectFirstResult());
StartHelpCommand = new RelayCommand(_ =>
{
Process.Start("https://aka.ms/PowerToys/");
});
OpenResultWithKeyboardCommand = new RelayCommand(index =>
{
OpenResultsEvent(index, false);
@@ -459,8 +453,6 @@ namespace PowerLauncher.ViewModel
public ICommand SelectFirstResultCommand { get; set; }
public ICommand StartHelpCommand { get; set; }
public ICommand LoadContextMenuCommand { get; set; }
public ICommand LoadHistoryCommand { get; set; }