예제 #1
0
        public static void Main(string[] args)
        {
            #region Prototype

            Abstraction ab = new RefinedAbstraction();

            ab.SetImplementor(new ConcreteImplementorA());
            ab.Operation();

            ab.SetImplementor(new ConcreteImplementorB());
            ab.Operation();

            Console.WriteLine();

            #endregion Prototype

            HandsetBrand handsetBrand = new HandsetBrandM();
            handsetBrand.SetHandsetSoft(new HandsetMp3());
            handsetBrand.Run();
            handsetBrand.SetHandsetSoft(new HandsetGame());
            handsetBrand.Run();

            handsetBrand = new HandsetBrandN();
            handsetBrand.SetHandsetSoft(new HandsetAddressList());
            handsetBrand.Run();

            Console.ReadLine();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            HandsetBrand handsetBrand = new HandsetBrandM();

            handsetBrand.SetHandsetSoft(new HandsetMp3());
            handsetBrand.Run();
            handsetBrand.SetHandsetSoft(new HandsetGame());
            handsetBrand.Run();

            handsetBrand = new HandsetBrandN();
            handsetBrand.SetHandsetSoft(new HandsetAddressList());
            handsetBrand.Run();

            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            HandsetBrand ab;

            ab = new HandsetBrandM();
            ab.SetHandsetSoft(new HandsetGame());
            ab.Run();
        }