public void AddTask(AbstractTask task) { if (_tasks.Count == TasksCount) { throw new InvalidOperationException("tasks capacity reached"); } if (!task.CanBeAssignedToSelf) { throw new InvalidOperationException("this type of task can't be assigned"); } _tasks.Add(task); }
public void RemoveTask(AbstractTask task) { _tasks.Remove(task); }