예제 #1
0
 public Trainee(Trainee other)
 {
     foreach (PropertyInfo prop in other.GetType().GetRuntimeProperties())
     {
         prop.SetValue(this, prop.GetValue(other));
     }
 }
예제 #2
0
파일: Trainee.cs 프로젝트: AviK311/WPF
 public Trainee(Trainee other)
 {
     notifications = new List <Notification>(other.notifications);
     foreach (PropertyInfo property in other.GetType().GetProperties())
     {
         if (property.CanWrite)
         {
             property.SetValue(this, property.GetValue(other));
         }
     }
     carTypeStats = new Dictionary <VehicleType, Stats>();
     foreach (var item in other.carTypeStats)
     {
         carTypeStats.Add(item.Key, new Stats(item.Value));
     }
 }