Пример #1
0
 public Constants(Constants constants)
 {
     Copy(constants);
 }
Пример #2
0
        public void Copy(Constants obj)
        {
            if (obj == null)
                return;

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