Add option to put computer to sleep

This commit is contained in:
kerams 2015-07-14 17:59:24 +02:00
parent 298e041b80
commit 2089406eaf
3 changed files with 17 additions and 6 deletions

View File

@ -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",

BIN
Wox/Images/sleep.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -396,6 +396,11 @@
<ItemGroup>
<None Include="Resources\app.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\sleep.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup>