示例#1
0
 internal Train()
 {
     Handle   = new Handle();
     Cab      = new Cab();
     Device   = new Device();
     Cars     = new ObservableCollection <Car>();
     Couplers = new ObservableCollection <Coupler>();
 }
示例#2
0
 public object Clone()
 {
     return(new Train
     {
         Handle = (Handle)Handle.Clone(),
         Cab = (Cab)Cab.Clone(),
         Device = (Device)Device.Clone(),
         Cars = new ObservableCollection <Car>(Cars.Select(c => (Car)c.Clone())),
         Couplers = new ObservableCollection <Coupler>(Couplers.Select(c => (Coupler)c.Clone()))
     });
 }