本文整理汇总了C#中Executor.QueueRestartTasks方法的典型用法代码示例。如果您正苦于以下问题:C# Executor.QueueRestartTasks方法的具体用法?C# Executor.QueueRestartTasks怎么用?C# Executor.QueueRestartTasks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executor
的用法示例。
在下文中一共展示了Executor.QueueRestartTasks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGUIInitInstance
private static bool OnGUIInitInstance(object sender)
{
GUIProgram program = (GUIProgram)sender;
eraserClient = new RemoteExecutorServer();
EraserSettings settings = EraserSettings.Get();
System.Threading.Thread.CurrentThread.CurrentUICulture =
new CultureInfo(settings.Language);
Application.SafeTopLevelCaptionFormat = S._("Eraser");
SettingsCompatibility.Execute();
try
{
if (System.IO.File.Exists(TaskListPath))
{
using (FileStream stream = new FileStream(TaskListPath, FileMode.Open,
FileAccess.Read, FileShare.Read))
{
eraserClient.Tasks.LoadFromStream(stream);
}
}
}
catch (SerializationException e)
{
System.IO.File.Delete(TaskListPath);
MessageBox.Show(S._("Could not load task list. All task entries have " +
"been lost. The error returned was: {0}", e.Message), S._("Eraser"),
MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1,
S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0);
}
program.MainForm = new MainForm();
program.MainForm.CreateControl();
bool showMainForm = true;
foreach (string param in program.CommandLine)
{
switch (param)
{
case "--atRestart":
eraserClient.QueueRestartTasks();
goto case "--quiet";
case "--quiet":
showMainForm = false;
break;
}
}
eraserClient.Run();
return showMainForm;
}
示例2: OnGUIInitInstance
private static void OnGUIInitInstance(object sender, InitInstanceEventArgs e)
{
GuiProgram program = (GuiProgram)sender;
eraserClient = new RemoteExecutorServer();
EraserSettings settings = EraserSettings.Get();
Thread.CurrentThread.CurrentUICulture = new CultureInfo(settings.Language);
Application.SafeTopLevelCaptionFormat = S._("Eraser");
SettingsCompatibility.Execute();
try
{
if (File.Exists(TaskListPath))
{
using (FileStream stream = new FileStream(TaskListPath, FileMode.Open,
FileAccess.Read, FileShare.Read))
{
eraserClient.Tasks.LoadFromStream(stream);
}
}
}
catch (SerializationException ex)
{
System.IO.File.Delete(TaskListPath);
MessageBox.Show(S._("Could not load task list. All task entries have " +
"been lost. The error returned was: {0}", ex.Message), S._("Eraser"),
MessageBoxButtons.OK, MessageBoxIcon.Error,
MessageBoxDefaultButton.Button1,
S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0);
}
program.MainForm = new MainForm();
GuiArguments arguments = new GuiArguments();
Args.Parse(program.CommandLine, CommandLinePrefixes, CommandLineSeparators, arguments);
e.ShowMainForm = !arguments.AtRestart && !arguments.Quiet;
if (arguments.AtRestart)
eraserClient.QueueRestartTasks();
eraserClient.Run();
}