static void Main() { List<MobileDevice> devices = new List<MobileDevice>(); MobileDevice gsm1 = new MobileDevice("Explorer", "HTC"); MobileDevice gsm2 = new MobileDevice("3G", "IPhone", 460); MobileDevice gsm3 = new MobileDevice("S55", "Siemens", 500, "Az"); devices.Add(gsm1); devices.Add(gsm2); devices.Add(gsm3); foreach (MobileDevice telefon in devices) { Console.WriteLine(telefon.ToString()); Console.WriteLine(); } Console.WriteLine(gsm3.IPshone4S.Price); Console.WriteLine(); Battery bat = new Battery(BatteryType.LiIon); MobileDevice nokia3310 = new MobileDevice("3310", "nokia"); nokia3310.AddToCallHistory(6548464, 22.13); List<Call> lc = nokia3310.CallHistory; foreach (var item in lc) { Console.WriteLine(item); } }
public MobileDevice(string model, string manifacturer, decimal price, string owner, Battery battery, Display display) : this(model, manifacturer, price, owner, battery) { this.display = display; this.callHistory = new List<Call>(); this.battery = new Battery(); this.display = new Display(); }
public MobileDevice(string model, string manifacturer, decimal price) : this(model, manifacturer) { this.price = price; this.callHistory = new List<Call>(); this.battery = new Battery(); this.display = new Display(); }
public MobileDevice(string model, string manifacturer) { this.model = model; this.manifacturer = manifacturer; this.callHistory = new List<Call>(); this.battery = new Battery(); this.display = new Display(); }