mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Fix issue#24
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Wox.UAC
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
PluginInstaller installer = new PluginInstaller();
|
||||
FileTypeAssociateInstaller installer = new FileTypeAssociateInstaller();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
@@ -16,32 +16,12 @@ namespace Wox.UAC
|
||||
{
|
||||
switch (param[1])
|
||||
{
|
||||
case "UAC":
|
||||
Invoke(param[2], param[3], param[4]);
|
||||
break;
|
||||
|
||||
case "AssociatePluginInstaller":
|
||||
installer.RegisterInstaller();
|
||||
break;
|
||||
|
||||
case "InstallPlugin":
|
||||
var path = param[2];
|
||||
installer.Install(path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Application.Current.Shutdown(0);
|
||||
}
|
||||
|
||||
private static void Invoke(string namespaceName, string className, string methodName)
|
||||
{
|
||||
Type type = Type.GetType(namespaceName + "." + className + "," + namespaceName);
|
||||
if (type != null)
|
||||
{
|
||||
object instance = Activator.CreateInstance(type);
|
||||
MethodInfo method = type.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
if (method != null) method.Invoke(instance, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user