static Car InstantiateCar() { List <Wheel> wheels = new List <Wheel>(); wheels.Add(new Wheel { Type = "Bridgestone" }); wheels.Add(new Wheel { Type = "Bridgestone" }); Radio radio = new Radio { Model = 2015, Type = "Sony" }; return(new Car { _Radio = radio, Wheels = wheels, Model = 2015, Type = "Chev", Price = 60000 }); }
protected Car(SerializationInfo info, StreamingContext context) : base(info, context) { Radio = (Radio)info.GetValue("Radio", typeof(Radio)); Wheel = (Wheel)info.GetValue("Wheel", typeof(Wheel)); }