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


C# Task.Clone方法代码示例

本文整理汇总了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;
 }
开发者ID:treejames,项目名称:MESDemo,代码行数:25,代码来源:frmEditTask.cs

示例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();
        }
开发者ID:klot-git,项目名称:scrum-factory,代码行数:55,代码来源:TaskViewModel.cs


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