本文整理汇总了C#中Task.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Task.Clone方法的具体用法?C# Task.Clone怎么用?C# Task.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.Clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frmEditTask
public frmEditTask(Task task, IDXMenuManager menuManager)
{
InitializeComponent();
this.task = task;
this.bindingTask = task.Clone();
InitEditors();
InitMenuManager(menuManager);
if(bindingTask.StartDate.HasValue)
deStartDate.DateTime = bindingTask.StartDate.Value;
if(bindingTask.DueDate.HasValue)
deDueDate.DateTime = bindingTask.DueDate.Value;
teSubject.DataBindings.Add("Text", bindingTask, "Subject");
icbStatus.DataBindings.Add("EditValue", bindingTask, "Status");
icbCategory.DataBindings.Add("EditValue", bindingTask, "Category");
icbPriority.DataBindings.Add("EditValue", bindingTask, "Priority");
sePercentComplete.DataBindings.Add("Value", bindingTask, "PercentComplete");
richEditControl1.DataBindings.Add("HtmlText", bindingTask, "Description");
UpdateCaption();
InitValidationProvider();
if(task.AssignTo != null) {
ucContactInfo1.Init(task.AssignTo, string.Empty);
splitContainerControl1.Collapsed = LayoutOption.TaskCollapsed;
} else
splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel1;
}
示例2: ShowDetail
public void ShowDetail(Task task, Project project, ICollection<TaskTag> tags)
{
Task = task;
oldTask = Task.Clone();
this.Project = project;
// no project, get it SYNC
if (project == null) {
this.Project = projectsService.GetProject(task.ProjectUId);
//aggregator.Publish<Project>(ScrumFactoryEvent.ViewProjectDetails, this.project);
}
ProjectRoles = this.Project.Roles;
ProjectMembers = AssigneeViewModel.CreateAssigneeCollection(this.Project.Memberships);
// just to make sure tha lines above did not mess my roleUId value
Task.RoleUId = oldTask.RoleUId;
// no tags, get tags async
if (tags == null) {
executor.StartBackgroundTask<ICollection<TaskTag>>(
() => { return tasksService.GetTaskTags(Project.ProjectUId); },
ts => {
Tags = ts;
TagUId = oldTask.TagUId;
});
} else {
this.Tags = tags;
}
// no detail , get it async
if (Task.TaskDetail == null) {
executor.StartBackgroundTask<ScrumFactory.TaskDetail>(
() => { return tasksService.GetTaskDetail(Task.TaskUId); },
d => {
if (d != null) {
TaskDetail = d.Detail;
oldTask.TaskDetail = d;
}
else {
TaskDetail = null;
oldTask.TaskDetail = null;
}
});
}
else
TaskDetail = Task.TaskDetail.Detail;
// no backlog item, get it async
executor.StartBackgroundTask<BacklogItem>(
() => { return backlogService.GetBacklogItem(task.BacklogItemUId); },
i => { BacklogItem = i; });
Show();
}