System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.CreateSectionWithRestrictedPermissions C# (CSharp) Метод

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

private CreateSectionWithRestrictedPermissions ( RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, object parentConfig, ConfigXmlReader reader ) : object
configRecord RuntimeConfigurationRecord
factoryRecord FactoryRecord
sectionRecord SectionRecord
parentConfig object
reader ConfigXmlReader
Результат object
            private object CreateSectionWithRestrictedPermissions(
                    RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord, SectionRecord sectionRecord, 
                    object parentConfig, ConfigXmlReader reader) {

                // run configuration section handlers as if user code was on the stack
                bool revertPermitOnly = false;
                try {
                    PermissionSet permissionSet = configRecord.GetRestrictedPermissions();
                    if (permissionSet != null) {
                        permissionSet.PermitOnly();
                        revertPermitOnly = true;
                    }

                    return CreateSectionImpl(configRecord, factoryRecord, sectionRecord, parentConfig, reader);
                }
                finally {
                    if (revertPermitOnly) {
                        CodeAccessPermission.RevertPermitOnly();
                    }
                }
            }