Esempio n. 1
0
File: Sys.cs Progetto: pluto92/Wox
 protected override void InitInternal(PluginInitContext context)
 {
     availableResults.Add(new Result
     {
         Title = "Shutdown",
         SubTitle = "Shutdown Computer",
         Score = 100,
         IcoPath = "Images\\exit.png",
         Action = (c) => Process.Start("shutdown","/s /t 0")
     });
     availableResults.Add(new Result
     {
         Title = "Log off",
         SubTitle = "Log off current user",
         Score = 20,
         IcoPath = "Images\\logoff.png",
         Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
     });
     availableResults.Add(new Result
     {
         Title = "Lock",
         SubTitle = "Lock this computer",
         Score = 20,
         IcoPath = "Images\\lock.png",
         Action = (c) => LockWorkStation()
     });
     availableResults.Add(new Result
     {
         Title = "Exit",
         SubTitle = "Close this app",
         Score = 110,
         IcoPath = "Images\\app.png",
         Action = (c) => context.CloseApp()
     });
 }
Esempio n. 2
0
File: Sys.cs Progetto: sdjc/Wox
 protected override void InitInternal(PluginInitContext context)
 {
     availableResults.Add(new Result
     {
         Title    = "Shutdown",
         SubTitle = "Shutdown Computer",
         Score    = 100,
         IcoPath  = "Images\\exit.png",
         Action   = (c) =>
         {
             Process.Start("shutdown", "/s /t 0");
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Log off",
         SubTitle = "Log off current user",
         Score    = 20,
         IcoPath  = "Images\\logoff.png",
         Action   = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
     });
     availableResults.Add(new Result
     {
         Title    = "Lock",
         SubTitle = "Lock this computer",
         Score    = 20,
         IcoPath  = "Images\\lock.png",
         Action   = (c) =>
         {
             LockWorkStation();
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Exit",
         SubTitle = "Close this app",
         Score    = 110,
         IcoPath  = "Images\\app.png",
         Action   = (c) =>
         {
             context.CloseApp();
             return(true);
         }
     });
 }
Esempio n. 3
0
 protected override void InitInternal(PluginInitContext context)
 {
     availableResults.Add(new Result
     {
         Title    = "Shutdown",
         SubTitle = "Shutdown Computer",
         Score    = 100,
         IcoPath  = "Images\\exit.png",
         Action   = (c) =>
         {
             Process.Start("shutdown", "/s /t 0");
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Log off",
         SubTitle = "Log off current user",
         Score    = 20,
         IcoPath  = "Images\\logoff.png",
         Action   = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
     });
     availableResults.Add(new Result
     {
         Title    = "Lock",
         SubTitle = "Lock this computer",
         Score    = 20,
         IcoPath  = "Images\\lock.png",
         Action   = (c) =>
         {
             LockWorkStation();
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Exit",
         SubTitle = "Close this app",
         Score    = 110,
         IcoPath  = "Images\\app.png",
         Action   = (c) =>
         {
             context.CloseApp();
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Restart Wox",
         SubTitle = "Restart Wox",
         Score    = 110,
         IcoPath  = "Images\\restart.png",
         Action   = (c) =>
         {
             ProcessStartInfo Info = new ProcessStartInfo();
             Info.Arguments        = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\"";
             Info.WindowStyle      = ProcessWindowStyle.Hidden;
             Info.CreateNoWindow   = true;
             Info.FileName         = "cmd.exe";
             Process.Start(Info);
             context.CloseApp();
             return(true);
         }
     });
     availableResults.Add(new Result
     {
         Title    = "Setting",
         SubTitle = "Tweak this app",
         Score    = 40,
         IcoPath  = "Images\\app.png",
         Action   = (c) =>
         {
             context.OpenSettingDialog();
             return(true);
         }
     });
 }
Esempio n. 4
0
 protected override void InitInternal(PluginInitContext context)
 {
     availableResults.Add(new Result
     {
         Title = "Shutdown",
         SubTitle = "Shutdown Computer",
         Score = 100,
         IcoPath = "Images\\exit.png",
         Action = (c) =>
         {
             Process.Start("shutdown", "/s /t 0");
             return true;
         }
     });
     availableResults.Add(new Result
     {
         Title = "Log off",
         SubTitle = "Log off current user",
         Score = 20,
         IcoPath = "Images\\logoff.png",
         Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0)
     });
     availableResults.Add(new Result
     {
         Title = "Lock",
         SubTitle = "Lock this computer",
         Score = 20,
         IcoPath = "Images\\lock.png",
         Action = (c) =>
         {
             LockWorkStation();
             return true;
         }
     });
     availableResults.Add(new Result
     {
         Title = "Exit",
         SubTitle = "Close this app",
         Score = 110,
         IcoPath = "Images\\app.png",
         Action = (c) =>
         {
             context.CloseApp();
             return true;
         }
     });
     availableResults.Add(new Result
     {
         Title = "Restart Wox",
         SubTitle = "Restart Wox",
         Score = 110,
         IcoPath = "Images\\restart.png",
         Action = (c) =>
         {
             ProcessStartInfo Info = new ProcessStartInfo();
             Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\"";
             Info.WindowStyle = ProcessWindowStyle.Hidden;
             Info.CreateNoWindow = true;
             Info.FileName = "cmd.exe";
             Process.Start(Info);
             context.CloseApp();
             return true;
         }
     });
     availableResults.Add(new Result
     {
         Title = "Setting",
         SubTitle = "Tweak this app",
         Score = 40,
         IcoPath = "Images\\app.png",
         Action = (c) =>
         {
             context.OpenSettingDialog();
             return true;
         }
     });
 }