/// <summary> /// Clone all fields using the ValueToString and StringToValue methods /// </summary> /// <param name="other"></param> protected virtual void ReadFromOther(PersistableSettings other) { foreach (PersistableItem item in m_Dictionary.Values) { foreach (PersistableItem itemOther in other.m_Dictionary.Values) { if (item.Name == itemOther.Name) { string valOther = itemOther.Validator.ValueToString(itemOther.Value); item.Value = item.Validator.StringToValue(valOther); break; } } } }
/// <summary> /// Clone all fields using the ValueToString and StringToValue methods /// </summary> /// <param name="other"></param> protected virtual void ReadFromOther(PersistableSettings other) { foreach (PersistableItem item in m_Dictionary.Values) { foreach (PersistableItem itemOther in other.m_Dictionary.Values) { if (item.Name == itemOther.Name) { string valOther = itemOther.Validator.ValueToString( itemOther.Value ); item.Value = item.Validator.StringToValue( valOther ); break; } } } }