public override bool Equals(object compareTo) {
ConfigurationElement compareToElem = compareTo as ConfigurationElement;
if (compareToElem == null ||
(compareTo.GetType() != this.GetType()) ||
((compareToElem != null) && (compareToElem.Properties.Count != this.Properties.Count))) {
return false;
}
foreach (ConfigurationProperty configProperty in this.Properties) {
if (!Object.Equals(Values[configProperty.Name], compareToElem.Values[configProperty.Name])) {
if (!(((Values[configProperty.Name] == null ||
Values[configProperty.Name] == s_nullPropertyValue) &&
Object.Equals(compareToElem.Values[configProperty.Name], configProperty.DefaultValue)) ||
((compareToElem.Values[configProperty.Name] == null ||
compareToElem.Values[configProperty.Name] == s_nullPropertyValue) &&
Object.Equals(Values[configProperty.Name], configProperty.DefaultValue))))
return false;
}
}
return true;
}