本文整理汇总了C#中Task.Postpone方法的典型用法代码示例。如果您正苦于以下问题:C# Task.Postpone方法的具体用法?C# Task.Postpone怎么用?C# Task.Postpone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.Postpone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
});
}
}
示例2: 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(() =>
{
});
}
}