ReSharper: remove redundant code

This commit is contained in:
bao-qian
2016-01-06 21:34:42 +00:00
parent ae42c4df16
commit 0daa3a8f57
65 changed files with 279 additions and 250 deletions

View File

@@ -76,14 +76,14 @@ namespace Wox.Plugin.Sys
private void LoadCommands()
{
availableResults.AddRange(new Result[]
availableResults.AddRange(new[]
{
new Result
{
Title = "Shutdown",
SubTitle = context.API.GetTranslation("wox_plugin_sys_shutdown_computer"),
IcoPath = "Images\\exit.png",
Action = (c) =>
Action = c =>
{
var reuslt = MessageBox.Show("Are you sure you want to shut the computer down?",
"Shutdown Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
@@ -99,7 +99,7 @@ namespace Wox.Plugin.Sys
Title = "Restart",
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart_computer"),
IcoPath = "Images\\restartcomp.png",
Action = (c) =>
Action = c =>
{
var result = MessageBox.Show("Are you sure you want to restart the computer?",
"Restart Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
@@ -115,14 +115,14 @@ namespace Wox.Plugin.Sys
Title = "Log off",
SubTitle = context.API.GetTranslation("wox_plugin_sys_log_off"),
IcoPath = "Images\\logoff.png",
Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
Action = c => ExitWindowsEx(EWX_LOGOFF, 0)
},
new Result
{
Title = "Lock",
SubTitle = context.API.GetTranslation("wox_plugin_sys_lock"),
IcoPath = "Images\\lock.png",
Action = (c) =>
Action = c =>
{
LockWorkStation();
return true;
@@ -133,14 +133,14 @@ namespace Wox.Plugin.Sys
Title = "Sleep",
SubTitle = context.API.GetTranslation("wox_plugin_sys_sleep"),
IcoPath = "Images\\sleep.png",
Action = (c) => FormsApplication.SetSuspendState(PowerState.Suspend, false, false)
Action = c => FormsApplication.SetSuspendState(PowerState.Suspend, false, false)
},
new Result
{
Title = "Empty Recycle Bin",
SubTitle = context.API.GetTranslation("wox_plugin_sys_emptyrecyclebin"),
IcoPath = "Images\\recyclebin.png",
Action = (c) =>
Action = c =>
{
// http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html
// 0 for nothing
@@ -160,7 +160,7 @@ namespace Wox.Plugin.Sys
Title = "Exit",
SubTitle = context.API.GetTranslation("wox_plugin_sys_exit"),
IcoPath = "Images\\app.png",
Action = (c) =>
Action = c =>
{
context.API.CloseApp();
return true;
@@ -171,7 +171,7 @@ namespace Wox.Plugin.Sys
Title = "Restart Wox",
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart"),
IcoPath = "Images\\restart.png",
Action = (c) =>
Action = c =>
{
context.API.RestarApp();
return false;
@@ -182,7 +182,7 @@ namespace Wox.Plugin.Sys
Title = "Settings",
SubTitle = context.API.GetTranslation("wox_plugin_sys_setting"),
IcoPath = "Images\\app.png",
Action = (c) =>
Action = c =>
{
context.API.OpenSettingDialog();
return true;

View File

@@ -11,7 +11,7 @@ namespace Wox.Plugin.Sys
foreach (var Result in Results)
{
this.lbxCommands.Items.Add(Result);
lbxCommands.Items.Add(Result);
}
}
}