コード例 #1
0
ファイル: CommandPattern.cs プロジェクト: VqSoft/VqDemos
        public static void Test()
        {
            AudioPlay player = new AudioPlay();

            PlayCommand playCmd = new PlayCommand(player);
            RewindCommand rewindCmd = new RewindCommand(player);
            StopCommand stopCmd = new StopCommand(player);

            //Keyboard kb = new Keyboard();
            //kb.PlayCommand = playCmd;
            //kb.RewindCommand = rewindCmd;
            //kb.StopCommand = stopCmd;
            //kb.Play();
            //kb.Rewind();
            //kb.Stop();

            IMacroCommand macroCmd = new MacroAudioCommand();
            macroCmd.Add(playCmd);
            macroCmd.Add(rewindCmd);
            macroCmd.Add(stopCmd);

            macroCmd.Execute();
        }
コード例 #2
0
ファイル: CommandPattern.cs プロジェクト: VqSoft/VqDemos
        public static void Test()
        {
            AudioPlay player = new AudioPlay();

            PlayCommand   playCmd   = new PlayCommand(player);
            RewindCommand rewindCmd = new RewindCommand(player);
            StopCommand   stopCmd   = new StopCommand(player);

            //Keyboard kb = new Keyboard();
            //kb.PlayCommand = playCmd;
            //kb.RewindCommand = rewindCmd;
            //kb.StopCommand = stopCmd;
            //kb.Play();
            //kb.Rewind();
            //kb.Stop();

            IMacroCommand macroCmd = new MacroAudioCommand();

            macroCmd.Add(playCmd);
            macroCmd.Add(rewindCmd);
            macroCmd.Add(stopCmd);

            macroCmd.Execute();
        }