public void RemoveTask(object task) { if (task != null && task is SingleTask singleTask) { if (TaskCollection != null && TaskCollection.Contains(singleTask)) { TaskCollection.Remove(singleTask); } } }
internal void AttachTask(TaskViewModel task) { if (!_tasks.Contains(task)) { _tasks.Add(task); var sorted = _tasks.OrderBy(t => t.Reactor.ReactorNumber).ToList(); _tasks.ReplaceWithRange(sorted); UpdateProcessTimes(); } }
public void CreateRoot() { var task = Collection.AddNew(); Assert.AreEqual(1, Collection.Count); Assert.IsTrue(Collection.Contains(task)); Collection.AddNew(); Assert.AreEqual(2, Collection.Count); Assert.IsTrue(Collection.Contains(task)); }
internal void OnFocusedTasksChanged(TaskCollection tasks) { IsHighlightActive = tasks != null && tasks.Count > 0; IsFocusedTask = ((tasks != null) && tasks.Contains(DataContext)); }