Esempio n. 1
0
        /// <summary>
        ///     Entry point into console application.
        /// </summary>
        static void Main()
        {
            Abstraction ab = new RefinedAbstraction();

            // Set implementation and call
            ab.Implementor = new ConcreteImplementorA();
            ab.Operation();

            // Change implemention and call
            ab.Implementor = new ConcreteImplementorB();
            ab.Operation();

            // Wait for user
            Console.ReadKey();
        }
Esempio n. 2
0
    /// <summary>
    /// Entry point into console application.
    /// </summary>
    static void Main()
    {
      Abstraction ab = new RefinedAbstraction();
 
      // Set implementation and call
      ab.Implementor = new ConcreteImplementorA();
      ab.Operation();
 
      // Change implemention and call
      ab.Implementor = new ConcreteImplementorB();
      ab.Operation();
 
      // Wait for user
      Console.ReadKey();
    }
Esempio n. 3
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        public static void Run()
        {
            Console.WriteLine("DoFactory GangOfFour IBridge Structural example.");
            Console.WriteLine();

            Abstraction ab = new RefinedAbstraction();

            // Set implementation and call
            ab.Implementor = new ConcreteImplementorA();
            ab.Operation();

            // Change implemention and call
            ab.Implementor = new ConcreteImplementorB();
            ab.Operation();

            Console.WriteLine();
            Console.WriteLine("******************************************");
            Console.WriteLine();
        }