System.Configuration.BaseConfigurationRecord.ValidateUniqueChildConfigSource C# (CSharp) Метод

ValidateUniqueChildConfigSource() защищенный Метод

protected ValidateUniqueChildConfigSource ( string configKey, string configSourceStreamName, string configSourceArg, IConfigErrorInfo errorInfo ) : void
configKey string
configSourceStreamName string
configSourceArg string
errorInfo IConfigErrorInfo
Результат void
        protected void ValidateUniqueChildConfigSource(
                string configKey, string configSourceStreamName, string configSourceArg, IConfigErrorInfo errorInfo) {

            //
            // Detect if a parent config file is using the same config source stream.
            //
            BaseConfigurationRecord current;
            if (IsLocationConfig) {
                current = _parent._parent;
            }
            else {
                current = _parent;
            }

            while (!current.IsRootConfig) {
                lock (current) {
                    if (current.ConfigStreamInfo.HasStreamInfos) {
                        StreamInfo streamInfo = (StreamInfo) current.ConfigStreamInfo.StreamInfos[configSourceStreamName];
                        if (streamInfo != null) {
                            throw new ConfigurationErrorsException(
                                SR.GetString(SR.Config_source_parent_conflict, configSourceArg),
                                errorInfo);
                        }
                    }
                }

                current = current.Parent;
            }
        }
BaseConfigurationRecord