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


C# Task.Complete方法代码示例

本文整理汇总了C#中Task.Complete方法的典型用法代码示例。如果您正苦于以下问题:C# Task.Complete方法的具体用法?C# Task.Complete怎么用?C# Task.Complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task的用法示例。


在下文中一共展示了Task.Complete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public void SetUp()
        {
            DateTimeHelper.Fix();

            _task = new Task();

            GoToInitialState(_task);

            DateTimeHelper.MoveAheadBy(TimeSpan.FromSeconds(50));

            _task.Complete();
        }
开发者ID:ArildF,项目名称:PTB,代码行数:12,代码来源:When_setting_a_task_back_to_completed.cs

示例2: SetUp

        public void SetUp()
        {
            DateTimeHelper.Fix();

            _task = new Task();

            DateTimeHelper.MoveAheadBy(TimeSpan.FromSeconds(30));

            _task.Start();

            DateTimeHelper.MoveAheadBy(TimeSpan.FromSeconds(100));

            _task.Complete();
        }
开发者ID:ArildF,项目名称:PTB,代码行数:14,代码来源:When_completing_a_task.cs

示例3: GoToInitialState

 protected virtual void GoToInitialState(Task task)
 {
     task.Complete();
 }
开发者ID:ArildF,项目名称:PTB,代码行数:4,代码来源:When_setting_a_task_back_to_InProgress.cs

示例4: GoToInitialState

 protected override void GoToInitialState(Task task)
 {
     task.Complete();
 }
开发者ID:ArildF,项目名称:PTB,代码行数:4,代码来源:When_setting_a_task_back_to_not_started.cs

示例5: TaskListContextMenuClick

        /// <summary>
        ///     This event is fired when a context menu action for an item is selected (Complete/Postpone).
        /// </summary>
        private void TaskListContextMenuClick(string menuItem, Task task)
        {
            // now that we have the associated task, we can take action on it.
            if (menuItem == "Complete")
            {
                task.Complete(() =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        IsLoading = false;
                    });

                    sReload = true;
                    LoadData();
                });
            }
            else if (menuItem == "Postpone")
            {
                task.Postpone(() =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        IsLoading = false;
                    });

                    sReload = true;
                    LoadData();
                });
            }
        }
开发者ID:ZainRizvi,项目名称:WinMilk,代码行数:33,代码来源:PivotLandingPage.xaml.cs

示例6: TaskListContextMenuClick

 /// <summary>
 ///     This event is fired when a context menu action for an item is selected (Complete/Postpone).
 /// </summary>
 private void TaskListContextMenuClick(string menuItem, Task task)
 {
     // now that we have the associated task, we can take action on it.
     if (menuItem == "Complete")
     {
         task.Complete(() =>
         {
             // Task was marked as complete, just remove it from the list.
             Dispatcher.BeginInvoke(() =>
             {
                 CurrentTag.Tasks.Remove(task);
             });
         });
     }
     else if (menuItem == "Postpone")
     {
         task.Postpone(() =>
         {
         });
     }
 }
开发者ID:ZainRizvi,项目名称:WinMilk,代码行数:24,代码来源:TagPage.xaml.cs


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