private void EnsureRequiredProperties(bool ensureKeysOnly) {
ConfigurationPropertyCollection props = Properties;
// Make sure all required properties are here
if (props != null) {
foreach (ConfigurationProperty prop in props) {
// The property is required but no value was found
if (prop.IsRequired && !_values.Contains(prop.Name)) {
// Required properties can be ommited when we need only the keys to be there
if (!ensureKeysOnly || prop.IsKey) {
_values[prop.Name] = OnRequiredPropertyNotFound(prop.Name);
}
}
}
}
}
protected virtual object OnRequiredPropertyNotFound(string name) {