System.Net.Configuration.ServicePointManagerElement.PostDeserialize C# (CSharp) Method

PostDeserialize() protected method

protected PostDeserialize ( ) : void
return void
        protected override void PostDeserialize()
        {
            // Perf optimization. If the configuration is coming from machine.config
            // It is safe and we don't need to check for permissions.
            if (EvaluationContext.IsMachineLevel)
                return;

            PropertyInformation[] protectedProperties = {
                ElementInformation.Properties[ConfigurationStrings.CheckCertificateName],
                ElementInformation.Properties[ConfigurationStrings.CheckCertificateRevocationList]
            };

            foreach (PropertyInformation property in protectedProperties)
                if (property.ValueOrigin == PropertyValueOrigin.SetHere)
                {
                    try {
                        ExceptionHelper.UnmanagedPermission.Demand();
                    } catch (Exception exception) {
                        throw new ConfigurationErrorsException(
                                      SR.GetString(SR.net_config_property_permission, 
                                                   property.Name),
                                      exception);
                    }
                }
        }