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

CreateSection() protected method

protected CreateSection ( bool inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, object parentConfig, ConfigXmlReader reader ) : object
inputIsTrusted bool
factoryRecord FactoryRecord
sectionRecord SectionRecord
parentConfig object
reader ConfigXmlReader
return object
        override protected object CreateSection(bool inputIsTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, object parentConfig, ConfigXmlReader reader) {
            // Create an instance of the ConfigurationSection
            ConstructorInfo ctor = (ConstructorInfo) factoryRecord.Factory;
            ConfigurationSection configSection = (ConfigurationSection) TypeUtil.InvokeCtorWithReflectionPermission(ctor);

            // Attach the ConfigurationSection to this record
            configSection.SectionInformation.AttachToConfigurationRecord(this, factoryRecord, sectionRecord);
            configSection.CallInit();

            // Initialize the ConfigurationSection with XML or just its parent.
            ConfigurationSection parentConfigSection = (ConfigurationSection) parentConfig;
            configSection.Reset(parentConfigSection);
            if (reader != null) {
                configSection.DeserializeSection(reader);
            }

            // Clear the modified bit.
            configSection.ResetModified();

            return configSection;
        }