public static void AddTask(ServerTask task) { task.PriorityChanged += OnTaskPriorityChanged; task.StatusChanged += OnTaskStatusChanged; Tasks.Add(task); TasksListChanged?.Invoke(Tasks); }
private static void OnTaskStatusChanged(ServerTask serverTask) { if (serverTask.Status == ServerTask.TaskStatus.Finished) { RemoveTask(serverTask); } var taskCopy = (ServerTask)serverTask.FlatCopy(); TasksListChanged?.Invoke(Tasks); TasksStatusChanged?.Invoke(taskCopy); ClientListChanged?.Invoke(LoggedClients); }
private static void OnTaskPriorityChanged(ServerTask serverTask) { TasksListChanged?.Invoke(Tasks); }
public static void RemoveTask(ServerTask task) { Tasks.Remove(task); TasksListChanged?.Invoke(Tasks); }