public void Initialize() { Settings.IValues settings = _settingsProvider.GetValues(); _currentState = _stateFactory.ConstructState(Name.Stopped); _currentContext = ContextFactory.Create(settings.EMail, settings.Password); EnterState(); _transitionSubscription = _messageMediator.GetEvent <ITransitionToStateMessage>().ObserveOn(_asyncHelper.AsyncScheduler).Subscribe(ProcessTransition); }
public void OnEnter(IContext context) { Instrumentation.State.EnteringState(Name.Stopped); _subscription = _messageMediator.GetEvent <IStartHarmonizingMessage>().Subscribe(message => ProcessMessage(context, message)); _messageMediator.Publish(new Messages.StoppedMessage()); Instrumentation.State.EnteringState(Name.Stopped); }
public void OnEnter(IContext context) { Instrumentation.State.EnteringState(Name.Authenticating); base.EnterStoppable(context); _subscription = _messageMediator.GetEvent <IAuthenticationResponseMessage>().Timeout(TimeSpan.FromSeconds(30)).Subscribe(response => ProcessResponse(context, response), exception => ProcessException(context, exception)); _messageMediator.Publish(new RequestAuthenticationMessage(context.EMail, context.Password)); Instrumentation.State.EnteredState(Name.Authenticating); }
public void OnEnter(IRegistrationContext context) { Instrumentation.State.EnteringState(Name.Started); base.EnterStoppable(context); _subscription = new CompositeDisposable( _messageMediator.GetEvent <With.Command.ICommand>().Subscribe(command => ProcessCommand(context, command)) ); _messageMediator.Publish(new Messages.StartedMessage()); Instrumentation.State.EnteredState(Name.Started); }
protected void EnterStoppable(IContext context) { _subscription = _messageMediator.GetEvent <IStopHarmonizingMessage>().Subscribe(message => Stop(context, message)); }
public void Initialize() { _subscription = _messageMediator.GetEvent <IRequestAuthenticationMessage>().Subscribe(ProcessRequest); }