Exemplo n.º 1
0
        //add an repeating or reoccuring task to list
        public void AddReOccuringTask(ToDoListItem toDoListItem, RepeatingTask repeatingTask)
        {
            if (toDoListItem is null)
            {
                throw new ArgumentNullException(nameof(toDoListItem));
            }


            if (repeatingTask.IsReOccuring == true)
            {
                items.Add(toDoListItem);// #@ this can be merge with add item of to do list
            }
        }
Exemplo n.º 2
0
        //add an repeating task as completed
        public void RepeatCompleted(ToDoListItem toDoListItem, RepeatingTask repeatingTask)
        {
            if (toDoListItem is null)
            {
                throw new ArgumentNullException(nameof(toDoListItem));
            }

            if (toDoListItem.IsCompleted == true)
            {
                tasks.Add(toDoListItem);
            }


            if (repeatingTask.EndTime <= DateTime.Now)
            {
                tasks.Remove(toDoListItem);     //task remove from completed
                ToDoList toDoList = new ToDoList();
                toDoList.AddItem(toDoListItem); //added to todo list again for next routine
            }
        }