static void Main(string[] args) { Abstraction ab = new RedefinedAbstraction(); ab.Implementor = new ConcreteImplementorA(); ab.Operation(); ab.Implementor = new ConcreteImplementorB(); ab.Operation(); }
/// <summary> /// The entry point of the program, where the program control starts and ends. /// </summary> /// <param name="args">The command-line arguments.</param> public static void Main(string[] args) { // create a redefined abstraction for concrete implementor A Abstraction ab = new RedefinedAbstraction(new ConcreteImplementorA()); // perform the high-level operation ab.Operation(); // create a redefined abstraction for concrete implementor B ab = new RedefinedAbstraction(new ConcreteImplementorB()); // perform the high-level operation ab.Operation(); }