コード例 #1
0
ファイル: StandByState.cs プロジェクト: schadinski/Studium
        //state immer erreichbar
        public override State Handle(VHSContext.Events currentEvent, TapeState tapeState)
        {
            switch (currentEvent)
            {
            case VHSContext.Events.PlayClicked:     //& tapeState==!TapeState._tapeEnd:
                //if Tape in and not end
                return(tapeState == TapeState._tapeIn ? _play : this);

            case VHSContext.Events.ForwardClicked:
                //if Tape in and not end
                return(tapeState == TapeState._tapeIn ? _forward : this);

            case VHSContext.Events.RewindClicked:
                //if Tape in and not begin
                return(tapeState == TapeState._tapeIn ? _reward : this);

            case VHSContext.Events.RecordClicked:
                //if Tape in and not end
                return(tapeState == TapeState._tapeIn ? _record : this);

            default:
                //pressed StopButton again
                return(this);
            }
        }
コード例 #2
0
ファイル: RecordState.cs プロジェクト: schadinski/Studium
        public override State Handle(VHSContext.Events currentEvent, TapeState tapeState)
        {
            switch (currentEvent)
            {
            case VHSContext.Events.StopClicked:
                return(tapeState != TapeState._tapeOut ? _standBy : this);

            default:
                //no switch from record to rewind
                //no switch from record to forward
                //no switch from record to play
                return(_record);
            }
        }
コード例 #3
0
ファイル: PlayState.cs プロジェクト: schadinski/Studium
        //nur ereichbar wenn tape in
        public override State Handle(VHSContext.Events currentEvent, TapeState tapeState)
        {
            switch (currentEvent)
            {
            case VHSContext.Events.StopClicked:
                return(tapeState != TapeState._tapeOut ? _standBy : this);

            case VHSContext.Events.ForwardClicked:
                return(tapeState != TapeState._tapeEnd ? _forward : this);

            case VHSContext.Events.RewindClicked:
                return(tapeState == TapeState._tapeIn ? _reward : this);

            default:
                //no switch from play to record
                return(this);
            }
        }
コード例 #4
0
        //state nur erreichbar wenn tapestate == in

        public override State Handle(VHSContext.Events currentEvent, TapeState tapeState)
        {
            switch (currentEvent)
            {
            case VHSContext.Events.PlayClicked:
                //if Tape not end
                return(tapeState != TapeState._tapeEnd ? _play: this);

            case VHSContext.Events.StopClicked:
                //if tape in
                return(tapeState == TapeState._tapeIn ? _standBy : this);

            case VHSContext.Events.ForwardClicked:
                //if tape not end
                return(tapeState != TapeState._tapeEnd ? _forward : this);

            default:
                //no switch from reward to record
                return(_reward);
            }
        }
コード例 #5
0
 public abstract State Handle(VHSContext.Events currentEvent, TapeState tapeState);