static void Main(string[] args) { Product product = new Product("123", "213", 100); Tech tech = new Tech("456", "789", "456789", 200); Tablet tablet = new Tablet(); Lab lab = new Lab(10); tablet.info.price = 300; lab.Add(product); lab.Add(tech); lab.Add(tablet); lab.Add(new Scanner()); lab.Add(new Printer()); lab.Add(new Product()); lab.show(); controller.show(lab); controller.sort(lab); lab.show(); lab.Del(tablet); lab.show(); }
static void Main(string[] args) { Product product = new Product("123", "213", 100); Tech tech = new Tech("456", "789", "456789", 200); Tablet tablet = new Tablet(); Lab lab = new Lab(6); Scanner scanner = new Scanner("2223", "32131", "11123", "231", 22360); tablet.info.price = 300; IAnotherInterface[] arr = new IAnotherInterface[3]; arr[0] = product; arr[1] = tech; arr[2] = tablet; try { Lab WrongLab = new Lab(100); WrongLab.Del(tablet); //arr[4].ToString(); lab.Add(product); lab.Add(tech); lab.Add(tablet); lab.Add(new Scanner()); lab.Add(new Printer()); lab.Add(new Product()); //lab.Add(new Product()); lab.show(); controller.show(lab); controller.sort(lab); lab.show(); lab.Del(tablet); //lab.Del(scanner); lab.show(); } catch (LabIsFull ex) { Console.WriteLine("LabIsFull Exception"); Console.WriteLine(ex.Message); } catch (ElementDoesNotExist ex) { Console.WriteLine("ElementDoesNotExist Exception"); Console.WriteLine(ex.Message); } catch (LabIsEmpty ex) { Console.WriteLine("LabIsEmpty 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); } }