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(); }
static void Main(string[] args) { AbstractClass aA = new ConcreteClassA(); aA.TemplateMethod(); AbstractClass aB = new ConcreteClassB(); aB.TemplateMethod(); }
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(); }
static void Main(string[] args) { AbstractClass theClass = new ConcreteClassA(); theClass.TemplateMethod(); theClass = new ConcreteClassB(); theClass.TemplateMethod(); Console.ReadKey(); }
public static void Main(string[] args) { AbstractClass c; c = new ConcreteClassA(); c.TemplateMethod(); c = new ConcreteClassB(); c.TemplateMethod(); Console.WriteLine("Done"); Console.Read(); }
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(); }
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(); }