Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //adding directly properties
            GSM testGSM = new GSM("s123", "samsung corp");
            Console.WriteLine("GSM model: {0} and manufacturer: {1}", testGSM.PhoneModel, testGSM.PhoneManufacturer);

            //another way
            testGSM.PhoneModel = "a1234";
            testGSM.PhoneManufacturer = "not samsung";

            //add new battery
            Battery bat = new Battery();
            bat.Model = "some123";
            bat.HoursTalk = 1.5;
            bat.HoursStandby = 2;
            //and adding it to the gsm
            testGSM.Battery = bat;
        }
Ejemplo n.º 2
0
 public GSM(string model, string manufacturer, decimal price, string owner, Battery gsmBattery)
     : this(model, manufacturer, price, owner)
 {
     this.gsmBattery = gsmBattery;
 }
Ejemplo n.º 3
0
 public GSM(string model, string manufacturer, decimal price, string owner, Battery gsmBattery)
     : this(model, manufacturer, price, owner)
 {
     this.gsmBattery = gsmBattery;
 }