示例#1
0
        static void Main(string[] args)
        {
            AbstractClass aA = new ConcreteClassA();
            aA.TemplateMethod();

            AbstractClass aB = new ConcreteClassB();
            aB.TemplateMethod();
        }
示例#2
0
        private static void Main(string[] args)
        {
            AbstractClass c = new ConcreteClassA();
            c.TemplateMethod();

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

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