コード例 #1
0
 public void StartListening()
 {
     _observable = _eventAggregator.GetEvent <ConnectionChangedEvent>().Subscribe(ConnectionChanged);
     _themeObs   = Observable
                   .FromEvent <ThemeChangedEventHandler, ThemeChangedEventArgs>(handler => VSColorTheme.ThemeChanged += handler, handler => VSColorTheme.ThemeChanged -= handler)
                   .Subscribe(args =>
     {
         CurrentTheme = ConvertToTheme(VSHelpers.DetectTheme());
         _eventAggregator.Publish(new ThemeChangedEvent(CurrentTheme));
     });
 }
コード例 #2
0
 private void OnConnectionChanged(ConnectionData connectionData)
 {
     _eventAggregator.Publish(new ConnectionChangedEvent(connectionData));
 }
コード例 #3
0
        public void ExecuteCommandWithConfirmation(string title, string message, ICommand command)
        {
            var ev = new ShowConfirmationEvent(title, message, command);

            _eventAggregator.Publish(ev);
        }
コード例 #4
0
 public void HandleKeyPress(IConnectionServiceBase connectionService, char key)
 {
     _eventAggregatorService.Publish <StateTransitionEventArgs>(new StateTransitionEventArgs(ConnectionState.Connected));
 }
コード例 #5
0
 public void MoveToState(IConnectionService connectionService, ConnectionState desiredState)
 {
     // Publish an event to the event aggregator. If the controller has subscribed to the aggregator it will be called.
     _eventAggregatorService.Publish <StateTransitionEventArgs>(new StateTransitionEventArgs(desiredState));
 }