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

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

private GetRuntimeObjectWithRestrictedPermissions ( ConfigurationSection section ) : object
section ConfigurationSection
Результат object
        private object GetRuntimeObjectWithRestrictedPermissions(ConfigurationSection section) {
            // Run configuration section handlers as if user code was on the stack
            bool revertPermitOnly = false;

            try {
                PermissionSet permissionSet = GetRestrictedPermissions();
                if (permissionSet != null) {
                    permissionSet.PermitOnly();
                    revertPermitOnly = true;
                }

                return section.GetRuntimeObject();
            }
            finally {
                if (revertPermitOnly) {
                    CodeAccessPermission.RevertPermitOnly();
                }
            }
        }