private void ValidateUniqueConfigSource(
string configKey, string configSourceStreamName, string configSourceArg, IConfigErrorInfo errorInfo) {
//
// Detect if another section in this file is using the same configSource
// with has a different section name.
//
lock (this) {
if (ConfigStreamInfo.HasStreamInfos) {
StreamInfo streamInfo = (StreamInfo) ConfigStreamInfo.StreamInfos[configSourceStreamName];
if (streamInfo != null && streamInfo.SectionName != configKey) {
throw new ConfigurationErrorsException(
SR.GetString(SR.Config_source_cannot_be_shared, configSourceArg),
errorInfo);
}
}
}
ValidateUniqueChildConfigSource(configKey, configSourceStreamName, configSourceArg, errorInfo);
}