本文整理汇总了C#中PluginInitContext.CloseApp方法的典型用法代码示例。如果您正苦于以下问题:C# PluginInitContext.CloseApp方法的具体用法?C# PluginInitContext.CloseApp怎么用?C# PluginInitContext.CloseApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInitContext
的用法示例。
在下文中一共展示了PluginInitContext.CloseApp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitInternal
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()
});
}
示例2: InitInternal
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;
}
});
}