Example #1
0
        public static void Run()
        {
            char key;

            while (true)
            {
                printMenu();

                key = Console.ReadKey().KeyChar;

                Console.WriteLine();
                switch (key)
                {
                case 's':
                    StrategyPatternExample.Display();
                    break;

                case 'o':
                    ObserverPatternExample.Display();
                    break;

                case 'c':
                    CommandPatternExample.Display();
                    break;

                case 'm':
                    CommandPatternMulti.Display();
                    CommandPatternMacro.Display();
                    break;

                case 't':
                    TemplateMethodPatternExample.Display();
                    break;

                case 'i':
                    IteratorPatternExample.Display();
                    break;

                case 'a':
                    NoStatePatternExample.Display();
                    StatePatternExample.Display();
                    break;

                case 'h':
                    ChainOfResponsibilityExample.Display();
                    break;

                case 'n':
                    InterpreterPatternExample.Display();
                    break;

                case 'd':
                    MediatorPatternExample.Display();
                    break;

                case 'e':
                    MementoPatternExample.Display();
                    break;

                case 'v':
                    VisitorPatternExample.Display();
                    break;

                case 'x': return;
                }
                Console.ReadKey();
            }
        }