Пример #1
0
        public static SubTask FromCopy(SubTask subTask)
        {
            SubTask newSubTask = new SubTask(subTask.Name, subTask.Description);

            newSubTask.Created = subTask.Created;
            newSubTask.Updated = subTask.Updated;
            newSubTask.Closed  = subTask.Closed;

            return(newSubTask);
        }
Пример #2
0
        public static Task FromCopy(Task task)
        {
            Task newTask = new Task(task.Name, task.Description, task.Note, task.Priority, task.State, task.Deadline);

            newTask.Created = task.Created;
            newTask.Updated = task.Updated;
            newTask.Closed  = task.Closed;
            newTask.Activities.AddRange(task.Activities);
            newTask.Tags.AddRange(task.Tags);
            newTask.Attachments.AddRange(task.Attachments);
            newTask.Drawings.AddRange(task.Drawings);
            newTask.SubTasks.AddRange(task.SubTasks.Select(x => SubTask.FromCopy(x)));

            return(newTask);
        }