Exemplo n.º 1
0
 internal void Remove(MovieTask task)
 {
     if (_collection.ContainsKey(task.GetSubscription()))
     {
         _collection.Remove(task.GetSubscription());
     }
 }
Exemplo n.º 2
0
        private void Task_Completed(MovieTask sender)
        {
            // var runningTasks = TaskCollection.GetAll().Where(i => i.IsBusy).Count();
            var runningTasks = TaskCollection.Count();

            if (runningTasks == 0)
            {
                //EventAggregator.GetEvent<LongProcessCompletedEvent>().
                //    Publish(1);
                Console.WriteLine("All processes completed.");
            }
            else if (runningTasks == 1)
            {
                //EventAggregator.GetEvent<LongProcessStartedEvent>().
                //    Publish(TaskCollection.GetAll().First().GetMessage());
                //publish message
            }
            else if (runningTasks > 1)
            {
                //EventAggregator.GetEvent<LongProcessStartedEvent>().
                //    Publish(string.Format("{0} processing running.", runningTasks));
                Console.WriteLine(string.Format("{0} processes running.", runningTasks));
            }
            TaskCollection.Remove(sender);
        }
Exemplo n.º 3
0
 internal void Add(MovieTask task)
 {
     _collection.Add(task.GetSubscription(), task);
 }