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();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            AbstractClass aA = new ConcreteClassA();
            aA.TemplateMethod();

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

            aA.TemplateMethod();

            AbstractClass aB = new ConcreteClassB();

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

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

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

            classA.TemplateMethod();

            AbstactClass classB = new ConcreteClassB();

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

            theClass.TemplateMethod();

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

            c.TemplateMethod();

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

            Console.ReadKey();
        }
Exemple #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();
        }
Exemple #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();
        }
Exemple #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();
        }