//Adds a new task to the task list //Invokes the task added event //Returns the newly created task public Task AddTask() { //Add task to the projects list Tasks.Add(new Task()); //If at least one subscription to the on task added event exists if (OnTaskAdded != null) { //Invoke the on task added event OnTaskAdded.Invoke(Tasks.Last()); } //Return the task return(Tasks.Last()); }
public void AddTask(ITask statusDetail) { TasksList.Add(statusDetail); OnTaskAdded?.Invoke(this, new TaskEventArgs(statusDetail)); }