Example #1
0
 public GSM(string model, string manufacturer, decimal? price, string owner, Battery battery, Display display)
 {
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Price = price;
     this.Owner = owner;
     this.battery = battery;
     this.display = display;
 }
        static void Main()
        {
            List<GSM> mobilePhones = new List<GSM>();

            Battery batOne = new Battery(BatteryType.LiIon, "HTC BAT", 200, 24);

            mobilePhones.Add(new GSM("HTC Space", "HTC", 1099.90m, "Tomsan", batOne, new Display(5.8m, 369750)));
            mobilePhones.Add(new GSM("Samsung Diamond", "Samsung", null, null, new Battery(BatteryType.NiMH, null, 420, null),
                                new Display(4.2m)));

            foreach (GSM device in mobilePhones)
            {
                Console.WriteLine(device.ToString());
            }

            Console.WriteLine(GSM.IPhone4S.ToString());
        }
Example #3
0
 public GSM(string model, string manufacturer, decimal? price, string owner, Battery battery)
     : this(model, manufacturer, price, owner, battery, null)
 {
 }