Beispiel #1
0
 public void Copy(FieldType fieldType)
 {
     // copy all of the properties
     foreach (PropertyInfo pi in fieldType.GetType().GetProperties())
     {
         // get the value of the property
         var val = pi.GetValue(fieldType, null);
         pi.SetValue(this, val, null);
     }
 }
Beispiel #2
0
        public void Copy(FieldType obj)
        {
            if (obj == null)
                return;

            // copy all of the properties
            foreach (PropertyInfo pi in obj.GetType().GetProperties())
            {
                // get the value of the property
                var val = pi.GetValue(obj, null);
                pi.SetValue(this, val, null);
            }
        }