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

hlNeedsChildFor() приватный Метод

private hlNeedsChildFor ( string configName ) : bool
configName string
Результат bool
        internal bool hlNeedsChildFor(string configName) {
            // Always return true for root config record
            if (IsRootConfig)
                return true;

            // Never create a child record when the parent has an exception.
            if (HasInitErrors) {
                return false;
            }

            string childConfigPath = ConfigPathUtility.Combine(_configPath, configName);

            try {
                using (Impersonate()) {
                    // check host if required
                    if (Host.IsConfigRecordRequired(childConfigPath)) {
                        return true;
                    }
                }
            }
            catch {
                // Don't allow frames up the stack to run exception filters while impersonated.
                throw;
            }

            // see if there's a location
            if (_flags[SupportsLocation]) {
                BaseConfigurationRecord configRecord = this;

                while (!configRecord.IsRootConfig) {
                    if (configRecord._locationSections != null) {
                        configRecord.ResolveLocationSections();
                        foreach (LocationSectionRecord locationSectionRecord in configRecord._locationSections) {
                            if (UrlPath.IsEqualOrSubpath(locationSectionRecord.SectionXmlInfo.TargetConfigPath, childConfigPath)) {
                                return true;
                            }
                        }
                    }

                    configRecord = configRecord._parent;
                }
            }

            return false;
        }
BaseConfigurationRecord