System.Configuration.MgmtConfigurationRecord.CreateSectionFactory C# (CSharp) Method

CreateSectionFactory() protected method

protected CreateSectionFactory ( FactoryRecord factoryRecord ) : object
factoryRecord FactoryRecord
return object
        override protected object CreateSectionFactory(FactoryRecord factoryRecord) {

            // Get the type of the factory
            Type type = TypeUtil.GetTypeWithReflectionPermission(Host, factoryRecord.FactoryTypeName, true);

            //
            // If the type is not a ConfigurationSection, use the DefaultSection if the type 
            // implements IConfigurationSectionHandler.
            //
            if (!typeof(ConfigurationSection).IsAssignableFrom(type)) {
                TypeUtil.VerifyAssignableType(typeof(IConfigurationSectionHandler), type, true);
                type = typeof(DefaultSection);
            }

            ConstructorInfo ctor = TypeUtil.GetConstructorWithReflectionPermission(type, typeof(ConfigurationSection), true);

            return ctor;
        }