Example #1
0
        public static void complexAbstractDemo()
        {
            System.Console.WriteLine("\n### complexAbstractDemo");

            AbstractItem[] items = new AbstractItem[5];
            items[0] = new VHS("StarWars", 130, 5043, VHSType.Size300);
            items[1] = new DVD("LoTR", 200, 20000, DVDType.LayerTwo);
            items[2] = new VHS("Matrix", 400, 432, VHSType.Size240);
            items[3] = new DVD("Bloff", 65, 55043, DVDType.LayerTwo);
            items[4] = new DVD("StarTrek", 2400, 20, DVDType.LayerOne);

            for (int i = 0; i < items.Length; i++)
            {
                System.Console.WriteLine(items[i].play());
            }
        }
Example #2
0
 public static void abstractPrint(AbstractItem item)
 {
     System.Console.WriteLine(item.play());
     System.Console.WriteLine(item.handle());
     System.Console.WriteLine();
 }