Пример #1
0
 public override void HandleNextEvent(StateMachine context)
 {
     context.MoveNext ();
     context.PlaySoundStart ();
     //context.ResetTimer ();
     context.ChangeState (PlayingInManualState.Instance);
 }
Пример #2
0
        public PhrasesPresenterIml(PhrasesView view, SoundPlayer player, Database db, int lessonNumber, State initialState)
        {
            this.view = view;
            this.player = player;
            this.db = db;
            this.lessonNumber = lessonNumber;

            player.PlayingFinished += (s, e) =>
            {
                HandlePlaySoundStopEvent ();
            //				new DelayedAction (() => {
            //					//	HandleNextEvent ();
            //				}, 5000);
                HandleTimeoutEvent ();
            };

            stateMachine = new StateMachine (this, initialState);

            var phrases = db.GetPhrasesByLesson (lessonNumber);

            enumerator = phrases.GetLoopedTwoWayEnumerator ();
            HandleNextEvent ();
        }
Пример #3
0
 public override void EnterState(StateMachine context)
 {
     context.EnterAutoMode ();
 }
 public override void HandlePreviousEvent(StateMachine context)
 {
     context.MovePrevious ();
     context.PlaySoundStart ();
     context.ChangeState (PlayingInManualState.Instance);
 }
Пример #5
0
 public override void HandlePreviousEvent(StateMachine context)
 {
     context.MovePrevious ();
     context.PlaySoundStart ();
 }
Пример #6
0
 public abstract void HandleTimeoutEvent(StateMachine stateMachine);
Пример #7
0
 public abstract void HandlePlaySoundStopEvent(StateMachine context);
Пример #8
0
 public abstract void HandleEnterManualModeEvent(StateMachine context);
Пример #9
0
 public override void EnterState(StateMachine context)
 {
     context.EnterManualMode ();
 }
Пример #10
0
 public override void HandleEnterManualModeEvent(StateMachine context)
 {
     context.ChangeState (AwaitingInManualState.Instance);
 }
Пример #11
0
 public override void HandleTimeoutEvent(StateMachine stateMachine)
 {
 }
Пример #12
0
 public override void HandlePlaySoundStopEvent(StateMachine context)
 {
     context.ChangeState (AwaitingInAutoState.Instance);
 }
Пример #13
0
 public override void HandlePlaySoundStartEvent(StateMachine context)
 {
     context.PlaySoundStart ();
 }
Пример #14
0
 public override void HandleEnterAutoModeEvent(StateMachine context)
 {
 }
Пример #15
0
 public override void HandleEnterManualModeEvent(StateMachine context)
 {
     // Empty default implementation
 }
Пример #16
0
 public override void HandlePlaySoundStartEvent(StateMachine context)
 {
     context.PlaySoundStart ();
     context.ChangeState (PlayingInAutoState.Instance);
 }
Пример #17
0
 public override void HandleTimeoutEvent(StateMachine stateMachine)
 {
     // Empty default implementation
 }
Пример #18
0
 public override void HandleTimeoutEvent(StateMachine context)
 {
     context.MoveNext ();
     context.PlaySoundStart ();
 }
Пример #19
0
 public abstract void HandleEnterAutoModeEvent(StateMachine context);
Пример #20
0
 public void SetUpEach()
 {
     presenter = new PhrasesPresenterMock ();
     stateMachine = new StateMachine (presenter);
 }
Пример #21
0
 public abstract void HandleNextEvent(StateMachine context);
Пример #22
0
 public override void HandleEnterAutoModeEvent(StateMachine context)
 {
     context.MoveNext ();
     context.PlaySoundStart ();
     context.ChangeState (AwaitingInAutoState.Instance);
 }
Пример #23
0
 public abstract void HandlePreviousEvent(StateMachine context);
Пример #24
0
 public override void HandlePlaySoundStopEvent(StateMachine context)
 {
     //throw new InvalidStateTransitionException ();
 }
Пример #25
0
 public virtual void EnterState(StateMachine context)
 {
     // Empty default implementation
 }
Пример #26
0
 public override void HandleEnterAutoModeEvent(StateMachine context)
 {
     context.ChangeState (PlayingInAutoState.Instance);
 }