Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
 protected void EnterStoppable(IContext context)
 {
     _subscription = _messageMediator.GetEvent <IStopHarmonizingMessage>().Subscribe(message => Stop(context, message));
 }
Example #6
0
 public void Initialize()
 {
     _subscription = _messageMediator.GetEvent <IRequestAuthenticationMessage>().Subscribe(ProcessRequest);
 }