/// <summary> /// Copies values from another SettingsValue object. If the destination contains more than one item, /// assumes it is a string list and appends values from the source object that are not currently in /// the array. /// </summary> /// <param name="source">The source settings.</param> public void CopyFrom(SettingValue source) { if (null != source) { m_value = source.m_value; m_default_value = source.m_default_value; } }
/// <summary> /// Determines if two SettingsValues have the same data and optionally compares default data. /// </summary> /// <param name="other">The other value.</param> /// <param name="compareDefaults">true if the default value should be compared.</param> /// <returns>true if this and other setting have the same value, optionally comparing the default. Otherwise, false.</returns> public bool ValuesAreEqual(SettingValue other, bool compareDefaults) { if (null == other) return false; if (0 != string.Compare(m_value, other.m_value, StringComparison.Ordinal)) return false; if (compareDefaults && 0 != string.Compare(m_default_value, other.m_default_value, StringComparison.Ordinal)) return false; return true; }
/// <summary> /// Determines if two SettingsValue have the same data. Does not compare default values. /// </summary> /// <param name="other">The other value.</param> /// <returns>true if this and other setting have the same value, without comparing the default. Otherwise, false.</returns> public bool ValuesAreEqual(SettingValue other) { return ValuesAreEqual(other, false); }