public virtual void Clone(Object source) { if (source == null) throw new ArgumentNullException("Source"); if (source.GetType() != this.GetType()) throw new ArgumentException("Type Mismatch"); foreach (PropertyInfo p in source.GetType().GetProperties()) if (p.CanRead && p.CanWrite) p.SetValue(this, p.GetValue(source, null), null); }
2 days ago
0 comments:
Post a Comment