private void AddImplicitSections(Hashtable factoryList) {
// Add implicit sections to the factoryList if we're under the root
// (e.g. if we're in machine.config)
if (_parent.IsRootConfig
) {
if (factoryList == null) {
factoryList = EnsureFactories();
}
FactoryRecord factoryRecord = (FactoryRecord)factoryList[RESERVED_SECTION_PROTECTED_CONFIGURATION];
// If the user has mistakenly declared an implicit section, we should leave the factoryRecord
// alone because it contains the error and the error will be thrown later.
if (factoryRecord != null) {
Debug.Assert(factoryRecord.HasErrors, "If the user has mistakenly declared an implicit section, we should have recorded an error.");
}
else {
factoryList[RESERVED_SECTION_PROTECTED_CONFIGURATION] =
new FactoryRecord(
RESERVED_SECTION_PROTECTED_CONFIGURATION, // configKey
string.Empty, // group
RESERVED_SECTION_PROTECTED_CONFIGURATION, // name
ProtectedConfigurationSectionTypeName, // factoryTypeName
true, // allowLocation
ConfigurationAllowDefinition.Everywhere, // allowDefinition
ConfigurationAllowExeDefinition.MachineToApplication, // allowExeDefinition
true, // restartOnExternalChanges
true, // requirePermission
true, // isFromTrustedConfig
true, // isUndeclared
null, // filename
-1); // lineNumber
}
}
}