GetParentWithFile() private method

private GetParentWithFile ( ) : Configuration
return Configuration
        public Configuration OpenConfiguration()
        {
            if (configuration == null)
            {
                if (!parentResolved)
                {
                    Configuration parentFile = parent.GetParentWithFile();
                    if (parentFile != null)
                    {
                        string parentRelativePath = parent.ConfigHost.GetConfigPathFromLocationSubPath(parent.LocationConfigPath, path);
                        parent = parentFile.FindLocationConfiguration(parentRelativePath, parent);
                    }
                }

                configuration = new Configuration(parent, path);
                using (XmlTextReader tr = new ConfigXmlTextReader(new StringReader(xmlContent), path))
                    configuration.ReadData(tr, allowOverride);

                xmlContent = null;
            }
            return(configuration);
        }
示例#2
0
        public Configuration OpenConfiguration()
        {
            if (OpenedConfiguration == null)
            {
                if (!_parentResolved)
                {
                    var parentFile = _parent.GetParentWithFile();
                    if (parentFile != null)
                    {
                        var parentRelativePath =
                            _parent.ConfigHost.GetConfigPathFromLocationSubPath(_parent.LocationConfigPath, Path);
                        _parent = parentFile.FindLocationConfiguration(parentRelativePath, _parent);
                    }
                }

                OpenedConfiguration = new Configuration(_parent, Path);
                using (var tr = XmlReader.Create(new StringReader(XmlContent)))
                    OpenedConfiguration.ReadData(tr, AllowOverride);

                XmlContent = null;
            }
            return(OpenedConfiguration);
        }