Beispiel #1
0
        static void Main(string[] args)
        {
            Product product = new Product("123", "213", 100, 500);
            Sweets  nyam    = new Sweets("456", "789", "456789", 200, 1300);
            Flower  rose    = new Flower();
            Gift    gift    = new Gift(10);

            rose.info.price = 300;
            IAnotherInterface[] arr = new IAnotherInterface[3];
            arr[0] = product;
            arr[1] = nyam;
            arr[2] = rose;

            try
            {
                Gift WrongLab = new Gift(100);
                WrongLab.Del(rose);
                //arr[4].ToString();
                gift.Add(product);
                gift.Add(nyam);
                gift.Add(rose);
                gift.Add(new Sweets());
                gift.Add(new Clocks());
                gift.Add(new Product());
                //lab.Add(new Product());


                gift.show();
                controller.show(gift);
                controller.sort(gift);
                gift.show();
                gift.Del(rose);
                //lab.Del(scanner);
                gift.show();
            }
            catch (LabIsFull ex)
            {
                Console.WriteLine("GiftIsFull Exception");
                Console.WriteLine(ex.Message);
            }
            catch (ElementDoesNotExist ex)
            {
                Console.WriteLine("ElementDoesNotExist Exception");
                Console.WriteLine(ex.Message);
            }
            catch (LabIsEmpty ex)
            {
                Console.WriteLine("GiftIsEmpty Exception");
                Console.WriteLine(ex.Message);
            }
            catch (WrongSize ex)
            {
                Console.WriteLine("WrongSize Exception");
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Another Exception");
                Console.WriteLine(ex.Message);
            }
        }