private object CreateSectionImpl(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, object parentConfig, ConfigXmlReader reader)
{
if (this._sectionCtor != null)
{
ConfigurationSection section = (ConfigurationSection)System.Configuration.TypeUtil.InvokeCtorWithReflectionPermission(this._sectionCtor);
section.SectionInformation.SetRuntimeConfigurationInformation(configRecord, factoryRecord, sectionRecord);
section.CallInit();
ConfigurationSection parentElement = (ConfigurationSection)parentConfig;
section.Reset(parentElement);
if (reader != null)
{
section.DeserializeSection(reader);
}
ConfigurationErrorsException errors = section.GetErrors();
if (errors != null)
{
throw errors;
}
section.SetReadOnly();
section.ResetModified();
return(section);
}
if (reader != null)
{
XmlNode xmlNode = ErrorInfoXmlDocument.CreateSectionXmlNode(reader);
CheckForLockAttributes(factoryRecord.ConfigKey, xmlNode);
object configContext = configRecord.Host.CreateDeprecatedConfigContext(configRecord.ConfigPath);
return(this._sectionHandler.Create(parentConfig, configContext, xmlNode));
}
return(null);
}