protected override List <Result> QueryInternal(Query query) { List <Result> results = new List <Result>(); if ("setting".Contains(query.RawQuery.ToLower())) { results.Add(new Result() { Title = "Wox Setting", Score = 40, IcoPath = "Images/app.png", Action = (contenxt) => { context.OpenSettingDialog(); return(true); } }); } return(results); }
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); } }); }
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; } }); }