Example #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));
     });
 }
 private void OnConnectionChanged(ConnectionData connectionData)
 {
     _eventAggregator.Publish(new ConnectionChangedEvent(connectionData));
 }
Example #3
0
        public void ExecuteCommandWithConfirmation(string title, string message, ICommand command)
        {
            var ev = new ShowConfirmationEvent(title, message, command);

            _eventAggregator.Publish(ev);
        }
Example #4
0
 public void HandleKeyPress(IConnectionServiceBase connectionService, char key)
 {
     _eventAggregatorService.Publish <StateTransitionEventArgs>(new StateTransitionEventArgs(ConnectionState.Connected));
 }
Example #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));
 }