Exemple #1
0
        public void Execute()
        {
            _notificationFactory.OperationsList(
                _sampleOperations.OperationsList.FindAll(op => op.Status == OperationStatus.Idle)
                ).NotifyAll();

            foreach (var operation in _sampleOperations.OperationsList)
            {
                _notificationFactory.CurrentOperation(operation).NotifyAll();

                Thread.Sleep(operation.Delay);

                operation.Status = OperationStatus.Completed;

                _notificationFactory.OperationsList(
                    _sampleOperations.OperationsList.FindAll(op => op.Status != OperationStatus.Completed)
                    ).NotifyAll();
            }

            _notificationFactory.GeneralStatus("All operations completed.").NotifyAll();
        }