本文整理汇总了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();
}
示例2: SetUp
public void SetUp()
{
DateTimeHelper.Fix();
_task = new Task();
DateTimeHelper.MoveAheadBy(TimeSpan.FromSeconds(30));
_task.Start();
DateTimeHelper.MoveAheadBy(TimeSpan.FromSeconds(100));
_task.Complete();
}
示例3: GoToInitialState
protected virtual void GoToInitialState(Task task)
{
task.Complete();
}
示例4: GoToInitialState
protected override void GoToInitialState(Task task)
{
task.Complete();
}
示例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();
});
}
}
示例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(() =>
{
});
}
}