Exemple #1
0
 private void TaskCompleted(SharpEncryptTaskModel task)
 {
     ActiveTasks.Remove(task);
     ActiveTasksGridView.Refresh();
     if (!ActiveTasks.Any())
     {
         AllTasksCompleted?.Invoke();
     }
 }
        public void TaskCompleted()
        {
            var allTasks       = _allTasks;
            var completedTasks = Interlocked.Increment(ref _completedTasks);

            if (allTasks == completedTasks)
            {
                IsCompleted = true;
                AllTasksCompleted?.Invoke(this, _empty);
            }
        }
Exemple #3
0
        private void ActiveTasksForm_Load(object sender, EventArgs e)
        {
            Text = ResourceManager.GetString("ActiveTasks");
            ActiveTasks.AddRange(TaskManager.Tasks);
            TaskManager.TaskCompleted        += TaskCompleted;
            TaskManager.TaskManagerCompleted += TaskManagerCompleted;
            if (!ActiveTasks.Any() || ActiveTasks.All(x => x.InnerTask.IsCompleted))
            {
                AllTasksCompleted?.Invoke();
            }

            ActiveTasksGridView.AutoGenerateColumns = false;
            ActiveTasksGridView.DataSource          = ActiveTasks;
            ActiveTasksGridView.Refresh();
        }
Exemple #4
0
 private void TaskManagerCompleted(bool hasRemainingTasks) => AllTasksCompleted?.Invoke();