Пример #1
0
        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
            });
        }
Пример #2
0
 protected Car(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     Radio = (Radio)info.GetValue("Radio", typeof(Radio));
     Wheel = (Wheel)info.GetValue("Wheel", typeof(Wheel));
 }