/// <summary> /// Populates instance class with another instance of class /// </summary> /// <param name="oth">The other instance to populate from</param> /// <param name="IgnoreArray">If True then Arrays are Ignored; Otherwise arrays are included</param> public void Populate(command oth, bool IgnoreArray) { foreach (PropertyInfo sourcePropertyInfo in oth.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if (sourcePropertyInfo.Name == @"Parent") { continue; } if ((IgnoreArray == true) && (sourcePropertyInfo.PropertyType.IsArray == true)) { continue; } PropertyInfo destPropertyInfo = this.GetType().GetProperty(sourcePropertyInfo.Name); if (destPropertyInfo.CanWrite == true) { destPropertyInfo.SetValue( this, sourcePropertyInfo.GetValue(oth, null), null); } } }
/// <summary> /// Populates instance class with another instance of class, Arrays are Ignored /// </summary> /// <param name="oth">The other instance to populate from</param> public void Populate(command oth) { Populate(oth, true); }
public CommandSimple(command cmd, string FileName) : this(cmd) { this.m_File = FileName; }