예제 #1
0
 static void Main(string [] args)
 {
     args = new string[10];
     //BuilderProgram.MainMethod(args);
     //MediatorProgram.MediatorMain(args);
     PrototypeProgram.PrototypeMain(args);
 }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please select a design pattern:");

            foreach (var item in Enum.GetValues(typeof(DesignPatternType)))
            {
                Console.WriteLine((int)item + ": " + item.ToString());
            }
            Console.Write("You select number :");

            var number = int.Parse(Console.ReadLine());

            switch (number)
            {
            case (int)DesignPatternType.Factory:
                FactoryProgram.Work();
                break;

            case (int)DesignPatternType.Builder:
                BuilderProgram.Work();
                break;

            case (int)DesignPatternType.Prototype:
                PrototypeProgram.Work();
                break;

            case (int)DesignPatternType.Singleton:
                SingletonProgram.Work();
                break;

            case (int)DesignPatternType.Bridge:
                BridgeProgram.Work();
                break;

            case (int)DesignPatternType.Proxy:
                ProxyProgram.Work();
                break;

            case (int)DesignPatternType.Strategy:
                StrategyProgram.Work();
                break;

            default:
                Console.Write("Not support!");
                break;
            }
        }