mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
7e9a626891
commit
a99b8399fe
2 changed files with 11 additions and 13 deletions
|
|
@ -206,7 +206,7 @@ namespace Flow.Launcher.Plugin.Sys
|
||||||
IcoPath = "Images\\shutdown.png",
|
IcoPath = "Images\\shutdown.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
MessageBoxResult result = _settings.SkipPowerActionConfirmation
|
var result = _settings.SkipPowerActionConfirmation
|
||||||
? MessageBoxResult.Yes
|
? MessageBoxResult.Yes
|
||||||
: Context.API.ShowMsgBox(
|
: Context.API.ShowMsgBox(
|
||||||
Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(),
|
Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(),
|
||||||
|
|
@ -231,7 +231,7 @@ namespace Flow.Launcher.Plugin.Sys
|
||||||
IcoPath = "Images\\restart.png",
|
IcoPath = "Images\\restart.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
MessageBoxResult result = _settings.SkipPowerActionConfirmation
|
var result = _settings.SkipPowerActionConfirmation
|
||||||
? MessageBoxResult.Yes
|
? MessageBoxResult.Yes
|
||||||
: Context.API.ShowMsgBox(
|
: Context.API.ShowMsgBox(
|
||||||
Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(),
|
Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(),
|
||||||
|
|
@ -283,16 +283,16 @@ namespace Flow.Launcher.Plugin.Sys
|
||||||
IcoPath = "Images\\logoff.png",
|
IcoPath = "Images\\logoff.png",
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
MessageBoxResult result = _settings.SkipPowerActionConfirmation
|
var result = _settings.SkipPowerActionConfirmation
|
||||||
? MessageBoxResult.Yes
|
? MessageBoxResult.Yes
|
||||||
: Context.API.ShowMsgBox(
|
: Context.API.ShowMsgBox(
|
||||||
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
|
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
|
||||||
Localize.flowlauncher_plugin_sys_log_off(),
|
Localize.flowlauncher_plugin_sys_log_off(),
|
||||||
MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
MessageBoxButton.YesNo, MessageBoxImage.Warning);
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
if (result == MessageBoxResult.Yes)
|
||||||
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
|
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Result
|
new Result
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,4 @@
|
||||||
{
|
{
|
||||||
public Settings Settings { get; } = settings;
|
public Settings Settings { get; } = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue