Beispiel #1
0
        public void Clone(TodoItem item)
        {
            var todoItem   = this.Find(item.ID);
            var clonedItem = item.Clone();

            _todoList.Add(clonedItem);
        }
Beispiel #2
0
        static void AddTaskAndChildrenRepeat(TodoItem task, string parentId, string date, int hours, string originalRepeatId, DateTimeOffset actionTime)
        {
            var ctask = task.Clone();

            ctask.ParentId         = parentId;
            ctask.Description     += date;
            ctask.Deadline         = task.Deadline?.AddHours(hours);
            ctask.Status           = TodoStatus.Active;
            ctask.OriginalRepeatId = originalRepeatId;
            AddTask(ctask, actionTime: actionTime);
            foreach (var child in Todos.Where(t => t.ParentId == task.Id).ToArray())
            {
                AddTaskAndChildrenRepeat(child, ctask.Id, date, hours, originalRepeatId, actionTime);
            }
        }