Esempio n. 1
0
        public static void AddTask(ServerTask task)
        {
            task.PriorityChanged += OnTaskPriorityChanged;
            task.StatusChanged   += OnTaskStatusChanged;

            Tasks.Add(task);
            TasksListChanged?.Invoke(Tasks);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 private static void OnTaskPriorityChanged(ServerTask serverTask)
 {
     TasksListChanged?.Invoke(Tasks);
 }
Esempio n. 4
0
 public static void RemoveTask(ServerTask task)
 {
     Tasks.Remove(task);
     TasksListChanged?.Invoke(Tasks);
 }