Esempio n. 1
0
        static void AdapterDemo()
        {
            IList <IWheel> wheels = new List <IWheel>();

            wheels.Add(new NarrowWheel(24));
            wheels.Add(new NarrowWheel(20));
            wheels.Add(new WideWheel(24));

            UltraWheel ultraWheel = new UltraWheel(22);

            wheels.Add(new UltraWheelAdapter(ultraWheel));

            foreach (IWheel item in wheels)
            {
                Console.WriteLine(item);
            }
        }
Esempio n. 2
0
 public UltraWheelAdapter(UltraWheel ultraWheel)
     : base(ultraWheel.WheelSize, false)
 {
 }