当前位置: 首页>>代码示例>>C#>>正文


C# ITaskManager.Start方法代码示例

本文整理汇总了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();
        }
开发者ID:KiselevKN,项目名称:BootMega,代码行数:16,代码来源:ResetViewModel.cs

示例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();
        }
开发者ID:KiselevKN,项目名称:BootMega,代码行数:16,代码来源:ConnectionViewModel.cs

示例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();
        }
开发者ID:KiselevKN,项目名称:BootMega,代码行数:18,代码来源:ReadViewModel.cs

示例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();
        }
开发者ID:KiselevKN,项目名称:BootMega,代码行数:18,代码来源:WriteViewModel.cs

示例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();
        }
开发者ID:KiselevKN,项目名称:BootMega,代码行数:18,代码来源:ReadViewModel.cs


注:本文中的ITaskManager.Start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。