Remove obsolete bool return

because hiding is now delegated to MainWindow.xaml's OnDeactivated()
This commit is contained in:
Jeremy Wu
2019-12-16 21:01:45 +11:00
parent bf33c82b19
commit 9d031c1600
3 changed files with 14 additions and 11 deletions

View File

@@ -191,22 +191,19 @@ namespace Wox.Plugin.Program
);
}
public static bool StartProcess(Func<ProcessStartInfo, Process> runProcess, ProcessStartInfo info)
public static void StartProcess(Func<ProcessStartInfo, Process> runProcess, ProcessStartInfo info)
{
bool hide;
try
{
runProcess(info);
hide = true;
}
catch (Exception)
{
var name = "Plugin: Program";
var message = $"Can't start: {info.FileName}";
var message = $"Unable to start: {info.FileName}";
_context.API.ShowMsg(name, message, string.Empty);
hide = false;
}
return hide;
}
public void ReloadData()

View File

@@ -319,11 +319,14 @@ namespace Wox.Plugin.Program.Programs
new Result
{
Title = api.GetTranslation("wox_plugin_program_open_containing_folder"),
Action = _ =>
{
var hide = Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location));
return hide;
Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location));
return true;
},
IcoPath = "Images/folder.png"
}
};

View File

@@ -64,8 +64,10 @@ namespace Wox.Plugin.Program.Programs
FileName = FullPath,
WorkingDirectory = ParentDirectory
};
var hide = Main.StartProcess(Process.Start, info);
return hide;
Main.StartProcess(Process.Start, info);
return true;
}
};
@@ -129,8 +131,9 @@ namespace Wox.Plugin.Program.Programs
Title = api.GetTranslation("wox_plugin_program_open_containing_folder"),
Action = _ =>
{
var hide = Main.StartProcess(Process.Start, new ProcessStartInfo(ParentDirectory));
return hide;
Main.StartProcess(Process.Start, new ProcessStartInfo(ParentDirectory));
return true;
},
IcoPath = "Images/folder.png"
}