예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                {//BasicStructure
                    AbstractClass c = new ConcreteClassA();
                    c.TemplateMethod();

                    c = new ConcreteClassB();
                    c.TemplateMethod();
                }
                {//SituationSimulation
                    AppleHandset appleHandset = new AppleHandset64G();
                    appleHandset.Assemble();

                    appleHandset = new AppleHandset128G();
                    appleHandset.Assemble();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            AbstractClass aA = new ConcreteClassA();
            aA.TemplateMethod();

            AbstractClass aB = new ConcreteClassB();
            aB.TemplateMethod();
        }
예제 #3
0
        static void Main(string[] args)
        {
            AbstractClass aA = new ConcreteClassA();

            aA.TemplateMethod();

            AbstractClass aB = new ConcreteClassB();

            aB.TemplateMethod();
        }
예제 #4
0
        private static void Main(string[] args)
        {
            AbstractClass c = new ConcreteClassA();
            c.TemplateMethod();

            c = new ConcreteClassB();
            c.TemplateMethod();

            Console.ReadKey();
        }
예제 #5
0
        static void Main(string[] args)
        {
            AbstactClass classA = new ConcreteClassA();

            classA.TemplateMethod();

            AbstactClass classB = new ConcreteClassB();

            classB.TemplateMethod();
        }
예제 #6
0
        static void Main(string[] args)
        {
            AbstractClass theClass = new ConcreteClassA();

            theClass.TemplateMethod();

            theClass = new ConcreteClassB();
            theClass.TemplateMethod();
            Console.ReadKey();
        }
예제 #7
0
        private static void Main(string[] args)
        {
            AbstractClass c = new ConcreteClassA();

            c.TemplateMethod();

            c = new ConcreteClassB();
            c.TemplateMethod();

            Console.ReadKey();
        }
예제 #8
0
        public static void Main(string[] args)
        {
            AbstractClass c;

            c = new ConcreteClassA();
            c.TemplateMethod();

            c = new ConcreteClassB();
            c.TemplateMethod();

            Console.WriteLine("Done");
            Console.Read();
        }
예제 #9
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Console.WriteLine("--------------------TemplateMethodPattern--------------------");
            Console.WriteLine();

            AbstractClass abstractClass = new ConcreteClassA();

            abstractClass.EatDumplings();
            var abstractClass1 = new ConcreteClassB();

            abstractClass1.EatDumplings();
            Console.ReadKey();
        }
예제 #10
0
        public static void Main(string[] args)
        {
            #region Prototype

            AbstractClass c = new ConcreteClassA();
            c.TemplateMethod();
            c = new ConcreteClassB();
            c.TemplateMethod();

            Console.WriteLine();

            #endregion Prototype

            var paper1 = new TestPaperA();
            paper1.TestResult();

            var pager2 = new TestPaperB();
            pager2.TestResult();

            Console.ReadLine();
        }