mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Refactoring command args and change the signal instance implement.
This commit is contained in:
32
Wox/CommandArgs/InstallPluginCommandArg.cs
Normal file
32
Wox/CommandArgs/InstallPluginCommandArg.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using Wox.Helper;
|
||||
|
||||
namespace Wox.CommandArgs
|
||||
{
|
||||
public class InstallPluginCommandArg : ICommandArg
|
||||
{
|
||||
public string Command
|
||||
{
|
||||
get { return "installplugin"; }
|
||||
}
|
||||
|
||||
public void Execute(IList<string> args)
|
||||
{
|
||||
if (args.Count > 0)
|
||||
{
|
||||
var path = args[0];
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
MessageBox.Show("Plugin " + path + " didn't exist");
|
||||
return;
|
||||
}
|
||||
PluginInstaller.Install(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user