コード例 #1
0
        public virtual IDisposable PublishCommand <T>(CommandBase <T> command, IObserver <ICommandResponse <T> > observer = null)
        {
            IDisposable subscription = null;

            if (observer != null)
            {
                subscription = command.Subscribe(observer);
            }
            AddCommand(command);
            return(subscription);
        }
コード例 #2
0
 protected virtual void HandleAddedCommand <T>(CommandBase <T> item)
 {
     item.SerialNumber = _commandCounter++;
     item.CurrentState = CommandState.Pending;
     PushToFilter(item);
     if (_subscriptions.ContainsKey(item))
     {
         _subscriptions[item].Dispose();
     }
     _subscriptions[item] = item.Subscribe(Observer.Create <ICommandResponse <T> >(
                                               _ => { },
                                               ex => { RemoveCommand(item); },
                                               () => { RemoveCommand(item); }));
 }
コード例 #3
0
 protected virtual void HandleAddedCommand(CommandBase item)
 {
     item.SerialNumber = _commandCounter++;
     item.CurrentState = CommandState.Pending;
     PushToFilter(item);
     if (_subscriptions.ContainsKey(item))
     {
         _subscriptions[item].Dispose();
     }
     _subscriptions[item] = item.Subscribe(u => { },
                                           ex =>
                                           RemoveCommand(item),
                                           () =>
                                           RemoveCommand(item));
 }