示例#1
0
        public static void Main(string[] args)
        {
            var disks = new IMusicDisks[] {
                new CompactDisk("Slayer ","Repentless","B00ZU6IVXW",21.99m,Currency.EUR),
                new CompactDisk("Night Falls Last ","Deathwalker","B00NDJF398",8.99m,Currency.EUR),
                new CompactDisk("Obscura ","Acróasis","B018A1MUEO",14.99m,Currency.EUR),
                new CompactDisk("Comeback Kid ","Die Knowing","B00HQ5XK04",20.99m,Currency.EUR),
                new CompactDisk("Architects ","Lost Forever/Lost Together","B00HUGK7N2",12.99m,Currency.EUR),
                new Vinyl("The Doors ","Doors",33,25,20.99m,Currency.EUR),
                new Vinyl("David Bowie ","Blackstar",45,30,21.99m,Currency.EUR),
                new Vinyl("Georg Danzer ","Traurig aber wahr",33,30,4.55m,Currency.EUR)
            };

            Console.WriteLine ("\n\n");

            SerializeDisks (disks);
        }
示例#2
0
        static void Main(string[] args)
        {
            var disks = new IMusicDisks[] {
                new CompactDisk("Slayer ","Repentless",21.99m,Currency.EUR,"B00ZU6IVXW"),
                new CompactDisk("Night Falls Last ","Deathwalker",8.99m,Currency.EUR,"B00NDJF398"),
                new CompactDisk("Obscura ","Acróasis",14.99m,Currency.EUR,"B018A1MUEO"),
                new CompactDisk("Comeback Kid ","Die Knowing",20.99m,Currency.EUR,"B00HQ5XK04"),
                new CompactDisk("Architects ","Lost Forever/Lost Together",12.99m,Currency.EUR,"B00HUGK7N2"),
                new Vinyl("The Doors ","Doors",20.99m,Currency.EUR,33,25),
                new Vinyl("David Bowie ","Blackstar",21.99m,Currency.EUR,45,30),
                new Vinyl("Georg Danzer ","Traurig aber wahr",4.55m,Currency.EUR,33,30)
            };

            var currency = Currency.EUR;
            foreach (var x in disks)
                Console.WriteLine ("{0} {1}", x.Description.PadRight(40,' '), x.GetPrice(currency));

            Console.WriteLine ("\n\n");
        }