System.Configuration.ConfigurationData.GetConfig C# (CSharp) Метод

GetConfig() публичный Метод

public GetConfig ( string sectionName ) : object
sectionName string
Результат object
		public object GetConfig (string sectionName)
		{
			object config;
			lock (this) {
				config = this.FileCache [sectionName];
			}

			if (config == emptyMark)
				return null;

			if (config != null)
				return config;

			lock (this) {
				config = GetConfigInternal (sectionName);
				this.FileCache [sectionName] = (config == null) ? emptyMark : config;
			}

			return config;
		}

Usage Example

Пример #1
0
        object GetConfigInternal(string sectionName)
        {
            object handler = GetHandler(sectionName);
            IConfigurationSectionHandler iconf = handler as IConfigurationSectionHandler;

            if (iconf == null)
            {
                return(handler);
            }

            object parentConfig = null;

            if (parent != null)
            {
                parentConfig = parent.GetConfig(sectionName);
            }

            XmlDocument doc = GetDocumentForSection(sectionName);

            if (doc == null || doc.DocumentElement == null)
            {
                return(parentConfig);
            }

            return(iconf.Create(parentConfig, fileName, doc.DocumentElement));
        }
All Usage Examples Of System.Configuration.ConfigurationData::GetConfig