本文整理汇总了C#中ITaskManager.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ITaskManager.Start方法的具体用法?C# ITaskManager.Start怎么用?C# ITaskManager.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITaskManager
的用法示例。
在下文中一共展示了ITaskManager.Start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResetViewModel
public ResetViewModel(SelectedSettings settings, string portName, ILoggerFacade logger)
: base(settings, portName, logger)
{
Text = Resources.TextReset;
taskm = new TaskManager<bool>((taskManager) =>
{
return (new ResetWorkerMaster(portName, settings.SettingsInfo.SerialPortSettings, logger)).Run(taskManager);
});
taskm.Canceled += taskm_Canceled;
taskm.Completed += taskm_Completed;
taskm.Faulted += taskm_Faulted;
taskm.Started += taskm_Started;
taskm.Start();
}
示例2: ConnectionViewModel
public ConnectionViewModel(SelectedSettings settings, string portName, ILoggerFacade logger)
: base(settings, portName, logger)
{
Text = Resources.TextConnection;
taskm = new TaskManager<Tuple<int, DateTime>>((taskManager) =>
{
return (new ConnectionWorkerMaster(portName, settings.SettingsInfo.SerialPortSettings, logger)).Run(taskManager);
});
taskm.Canceled += taskm_Canceled;
taskm.Completed += taskm_Completed;
taskm.Faulted += taskm_Faulted;
taskm.Started += taskm_Started;
taskm.Start();
}
示例3: ReadViewModel
public ReadViewModel(SelectedSettings settings, string portName, ILoggerFacade logger)
: base(settings, portName, logger)
{
Text = string.Format(Resources.TextAnalysis, GetMemoryType());
taskmIsEmptyPage = new TaskManager<List<int>, double>((taskManager) =>
{
return (new IsEmptyPageWorkerMaster(portName, settings.SettingsInfo.SerialPortSettings, logger,
settings.MemoryType, settings.SettingsInfo.Processor)).Run(taskManager);
});
taskmIsEmptyPage.Canceled += taskmIsEmptyPage_Canceled;
taskmIsEmptyPage.Completed += taskmIsEmptyPage_Completed;
taskmIsEmptyPage.Faulted += taskmIsEmptyPage_Faulted;
taskmIsEmptyPage.Started += taskmIsEmptyPage_Started;
taskmIsEmptyPage.Progressed += taskmIsEmptyPage_Progressed;
taskmIsEmptyPage.Start();
}
示例4: WriteViewModel
public WriteViewModel(SelectedSettings settings, string portName, ILoggerFacade logger, IMemory memory)
: base(settings, portName, logger)
{
Text = string.Format(Resources.TextWrite, GetMemoryType());
taskm = new TaskManager<bool, double>((taskManager) =>
{
return (new WritePageWorkerMaster(portName, settings.SettingsInfo.SerialPortSettings, logger,
settings.MemoryType, settings.SettingsInfo.Processor, memory)).Run(taskManager);
});
taskm.Canceled += taskm_Canceled;
taskm.Completed += taskm_Completed;
taskm.Faulted += taskm_Faulted;
taskm.Started += taskm_Started;
taskm.Progressed += taskm_Progressed;
taskm.Start();
}
示例5: taskmIsEmptyPage_Completed
private void taskmIsEmptyPage_Completed(object sender, TaskCompletedEventArgs<List<int>> e)
{
Text = string.Format(Resources.TextRead, GetMemoryType());
logger.Log(string.Format(Resources.IsEmptyCompleted, GetMemoryType()), Category.Debug, Priority.None);
taskm = new TaskManager<IMemory, double>((taskManager) =>
{
return (new ReadPageWorkerMaster(portName, settings.SettingsInfo.SerialPortSettings, logger,
settings.MemoryType, settings.SettingsInfo.Processor, e.Result)).Run(taskManager);
});
taskm.Canceled += taskm_Canceled;
taskm.Completed += taskm_Completed;
taskm.Faulted += taskm_Faulted;
taskm.Started += taskm_Started;
taskm.Progressed += taskm_Progressed;
taskm.Start();
}