Skip to content

Commit 827b6ed

Browse files
committed
Improve code quality
1 parent 9917de9 commit 827b6ed

File tree

1 file changed

+9
-13
lines changed
  • Plugins/Flow.Launcher.Plugin.Sys

1 file changed

+9
-13
lines changed

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ private List<Result> Commands()
120120
context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_shutdown_computer"),
121121
context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer"),
122122
MessageBoxButton.YesNo, MessageBoxImage.Warning);
123+
123124
if (result == MessageBoxResult.Yes)
124-
{
125125
Process.Start("shutdown", "/s /t 0");
126-
}
127126

128127
return true;
129128
}
@@ -140,10 +139,9 @@ private List<Result> Commands()
140139
context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_restart_computer"),
141140
context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer"),
142141
MessageBoxButton.YesNo, MessageBoxImage.Warning);
142+
143143
if (result == MessageBoxResult.Yes)
144-
{
145144
Process.Start("shutdown", "/r /t 0");
146-
}
147145

148146
return true;
149147
}
@@ -204,7 +202,11 @@ private List<Result> Commands()
204202
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_sleep"),
205203
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xec46"),
206204
IcoPath = "Images\\sleep.png",
207-
Action = c => PInvoke.SetSuspendState(false, false, false)
205+
Action = c =>
206+
{
207+
PInvoke.SetSuspendState(false, false, false);
208+
return true;
209+
}
208210
},
209211
new Result
210212
{
@@ -231,10 +233,7 @@ private List<Result> Commands()
231233
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe773"),
232234
Action = c =>
233235
{
234-
{
235-
System.Diagnostics.Process.Start("control.exe", "srchadmin.dll");
236-
}
237-
236+
Process.Start("control.exe", "srchadmin.dll");
238237
return true;
239238
}
240239
},
@@ -272,10 +271,7 @@ private List<Result> Commands()
272271
CopyText = recycleBinFolder,
273272
Action = c =>
274273
{
275-
{
276-
System.Diagnostics.Process.Start("explorer", recycleBinFolder);
277-
}
278-
274+
Process.Start("explorer", recycleBinFolder);
279275
return true;
280276
}
281277
},

0 commit comments

Comments
 (0)