Skip to content

Commit a99b839

Browse files
committed
Improve code quality
1 parent 7e9a626 commit a99b839

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private List<Result> Commands(Query query)
206206
IcoPath = "Images\\shutdown.png",
207207
Action = c =>
208208
{
209-
MessageBoxResult result = _settings.SkipPowerActionConfirmation
209+
var result = _settings.SkipPowerActionConfirmation
210210
? MessageBoxResult.Yes
211211
: Context.API.ShowMsgBox(
212212
Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(),
@@ -231,7 +231,7 @@ private List<Result> Commands(Query query)
231231
IcoPath = "Images\\restart.png",
232232
Action = c =>
233233
{
234-
MessageBoxResult result = _settings.SkipPowerActionConfirmation
234+
var result = _settings.SkipPowerActionConfirmation
235235
? MessageBoxResult.Yes
236236
: Context.API.ShowMsgBox(
237237
Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(),
@@ -283,16 +283,16 @@ private List<Result> Commands(Query query)
283283
IcoPath = "Images\\logoff.png",
284284
Action = c =>
285285
{
286-
MessageBoxResult result = _settings.SkipPowerActionConfirmation
287-
? MessageBoxResult.Yes
288-
: Context.API.ShowMsgBox(
289-
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
290-
Localize.flowlauncher_plugin_sys_log_off(),
291-
MessageBoxButton.YesNo, MessageBoxImage.Warning);
292-
293-
if (result == MessageBoxResult.Yes)
294-
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
295-
return true;
286+
var result = _settings.SkipPowerActionConfirmation
287+
? MessageBoxResult.Yes
288+
: Context.API.ShowMsgBox(
289+
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
290+
Localize.flowlauncher_plugin_sys_log_off(),
291+
MessageBoxButton.YesNo, MessageBoxImage.Warning);
292+
293+
if (result == MessageBoxResult.Yes)
294+
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
295+
return true;
296296
}
297297
},
298298
new Result

Plugins/Flow.Launcher.Plugin.Sys/SettingsViewModel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ public class SettingsViewModel(Settings settings)
44
{
55
public Settings Settings { get; } = settings;
66
}
7-
8-
97
}

0 commit comments

Comments
 (0)