public HotstringSimple(hotstring hs) : this() { this.m_Category = hs.category; this.m_Description = hs.description; this.m_Name = hs.name; this.m_Trigger = hs.trigger; this.m_Enabled = hs.enabled; }
/// <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(hotstring 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(hotstring oth) { Populate(oth, true); }
public HotstringSimple(hotstring hs, string FileName) : this(hs) { this.m_File = FileName; }