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

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

private GetHandler ( string sectionName ) : object
sectionName string
Результат object
		object GetHandler (string sectionName)
		{
			lock (factories) {
				object o = factories [sectionName];
				if (o == null || o == removedMark) {
					if (parent != null)
						return parent.GetHandler (sectionName);

					return null;
				}

				if (o is IConfigurationSectionHandler)
					return (IConfigurationSectionHandler) o;

				o = CreateNewHandler (sectionName, (SectionData) o);
				factories [sectionName] = o;
				return o;
			}
		}

Usage Example

        object GetHandler(string sectionName)
        {
            lock (factories)
            {
                object o = factories [sectionName];
                if (o == null || o == removedMark)
                {
                    if (parent != null)
                    {
                        return(parent.GetHandler(sectionName));
                    }

                    return(null);
                }

                if (o is IConfigurationSectionHandler)
                {
                    return((IConfigurationSectionHandler)o);
                }

                o = CreateNewHandler(sectionName, (SectionData)o);
                factories [sectionName] = o;
                return(o);
            }
        }