本文整理汇总了C#中ITask.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ITask.Start方法的具体用法?C# ITask.Start怎么用?C# ITask.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITask
的用法示例。
在下文中一共展示了ITask.Start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start(byte[] serializedJob) {
try {
creationTime = DateTime.Now;
task = PersistenceUtil.Deserialize<ITask>(serializedJob);
RegisterJobEvents();
task.Start();
if (!startTaskSem.WaitOne(Settings.Default.ExecutorSemTimeouts)) {
throw new TimeoutException("Timeout when starting the task. TaskStarted event was not fired.");
}
}
catch (Exception e) {
HandleStartStopPauseError(e);
}
finally {
taskStartedSem.Set();
}
}
示例2: Enable
/// <summary>
/// makes thumbnail visible, setting EffectEnabled properly, and loading thumbnail image if not yet loaded/loading.
/// </summary>
public void Enable()
{
Visible = true;
EffectEnabled = (Texture != DefaultTexture);
if (loaderTask == null)
{
loaderTask = new ThreadedTask(new GameThumbnailLoadTask(this));
loaderTask.Start();
}
}
示例3: LoadInBackground
/// <summary>
/// trigger the background loading in a thread of the game's thumbnail image.
/// Does nothing if loading already in progress or finished.
/// </summary>
public void LoadInBackground()
{
if (loaderTask == null)
{
loaderTask = new ThreadedTask(new GameThumbnailLoadTask(this));
loaderTask.Start();
}
}
示例4: StartInternal
protected override void StartInternal()
{
try
{
switch (fileType)
{
case PackedFileType.ZIP:
unpackTask = new UnzipTask(filename, destFolder);
break;
case PackedFileType.RAR:
unpackTask = new UnrarTask(filename, destFolder);
break;
case PackedFileType.EXE_NOT_PACKED:
case PackedFileType.BIN_NOT_PACKED:
case PackedFileType.SWF_NOT_PACKED:
unpackTask = new CopyFileTask(filename, destFolder, exeFile);
break;
case PackedFileType.OGG_MUSIC:
unpackTask = new CopyFileTask(filename, destFolder, exeFile);
break;
default:
throw new NotImplementedException("unpackertask fileType");
}
unpackTask.Start();
status = unpackTask.Status();
statusMsg = unpackTask.StatusMsg();
}
catch (Exception ex)
{
status = ITaskStatus.FAIL;
statusMsg = ex.ToString();
}
}