From 2089406eaf53b248a0a32a463a3c42d517350eda Mon Sep 17 00:00:00 2001 From: kerams Date: Tue, 14 Jul 2015 17:59:24 +0200 Subject: [PATCH] Add option to put computer to sleep --- Wox.Plugin.SystemPlugins/Sys/Sys.cs | 18 ++++++++++++------ Wox/Images/sleep.png | Bin 0 -> 1240 bytes Wox/Wox.csproj | 5 +++++ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 Wox/Images/sleep.png diff --git a/Wox.Plugin.SystemPlugins/Sys/Sys.cs b/Wox.Plugin.SystemPlugins/Sys/Sys.cs index 50a2a6e859..15826859a8 100644 --- a/Wox.Plugin.SystemPlugins/Sys/Sys.cs +++ b/Wox.Plugin.SystemPlugins/Sys/Sys.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; using System.Windows.Forms; +using Control = System.Windows.Controls.Control; namespace Wox.Plugin.SystemPlugins.Sys { @@ -51,7 +49,7 @@ namespace Wox.Plugin.SystemPlugins.Sys #endregion - public System.Windows.Controls.Control CreateSettingPanel() + public Control CreateSettingPanel() { return new SysSettings(availableResults); } @@ -109,7 +107,15 @@ namespace Wox.Plugin.SystemPlugins.Sys return true; } }, - new Result + new Result + { + Title = "Sleep", + SubTitle = "Put computer to sleep", + Score = 100, + IcoPath = "Images\\sleep.png", + Action = (c) => Application.SetSuspendState(PowerState.Suspend, false, false) + }, + new Result { Title = "Exit", SubTitle = "Close this app", diff --git a/Wox/Images/sleep.png b/Wox/Images/sleep.png new file mode 100644 index 0000000000000000000000000000000000000000..c7668e7f2911ad1e642b469eb03c8c5fde56e357 GIT binary patch literal 1240 zcmV;}1Sk86P)$CL61Eo8q|Z(OB3o-4;Dly z6x2fmQi05rC1herm?hL`p;Bs!CgbRQHO|L9XYaLoxX$<7`Eu-k*l-SO@BRPpwHAA= zV;F}WdwU*95;o^N4XTtFP!<6S#ux_Ej^8ql-7U=(M@MXCk6u{#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