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();
        }
Exemple #2
0
        public void Execute()
        {
            if (_clientId == Guid.Empty)
            {
                return;
            }

            if (_clientsManagement.IsRegistered(_clientId))
            {
                return;
            }

            var newClient = new ClientModel()
            {
                Id = _clientId,
                CallbackChannel = OperationContext.Current.GetCallbackChannel <ICallbackContract>()
            };

            _clientsManagement.Insert(newClient);

            _notificationFactory.GeneralStatus("Registered successfully.").NotifyById(_clientId);
        }