Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / ServicePointManagerElement.cs / 1305376 / ServicePointManagerElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Net.Security; using System.Reflection; using System.Security.Permissions; public sealed class ServicePointManagerElement : ConfigurationElement { public ServicePointManagerElement() { this.properties.Add(this.checkCertificateName); this.properties.Add(this.checkCertificateRevocationList); this.properties.Add(this.dnsRefreshTimeout); this.properties.Add(this.enableDnsRoundRobin); this.properties.Add(this.encryptionPolicy); this.properties.Add(this.expect100Continue); this.properties.Add(this.useNagleAlgorithm); } 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); } } } [ConfigurationProperty(ConfigurationStrings.CheckCertificateName, DefaultValue = true)] public bool CheckCertificateName { get { return (bool)this[this.checkCertificateName]; } set { this[this.checkCertificateName] = value; } } [ConfigurationProperty(ConfigurationStrings.CheckCertificateRevocationList, DefaultValue = false)] public bool CheckCertificateRevocationList { get { return (bool)this[this.checkCertificateRevocationList]; } set { this[this.checkCertificateRevocationList] = value; } } [ConfigurationProperty(ConfigurationStrings.DnsRefreshTimeout, DefaultValue = (int)( 2 * 60 * 1000))] public int DnsRefreshTimeout { get { return (int)this[this.dnsRefreshTimeout]; } set { this[this.dnsRefreshTimeout] = value; } } [ConfigurationProperty(ConfigurationStrings.EnableDnsRoundRobin, DefaultValue = false)] public bool EnableDnsRoundRobin { get { return (bool)this[this.enableDnsRoundRobin]; } set { this[this.enableDnsRoundRobin] = value; } } [ConfigurationProperty(ConfigurationStrings.EncryptionPolicy, DefaultValue = EncryptionPolicy.RequireEncryption)] public EncryptionPolicy EncryptionPolicy { get { return (EncryptionPolicy)this[this.encryptionPolicy]; } set { this[this.encryptionPolicy] = value; } } [ConfigurationProperty(ConfigurationStrings.Expect100Continue, DefaultValue = true)] public bool Expect100Continue { get { return (bool)this[this.expect100Continue]; } set { this[this.expect100Continue] = value; } } [ConfigurationProperty(ConfigurationStrings.UseNagleAlgorithm, DefaultValue=true)] public bool UseNagleAlgorithm { get { return (bool)this[this.useNagleAlgorithm]; } set { this[this.useNagleAlgorithm] = value; } } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty checkCertificateName = new ConfigurationProperty(ConfigurationStrings.CheckCertificateName, typeof(bool), true, ConfigurationPropertyOptions.None); readonly ConfigurationProperty checkCertificateRevocationList = new ConfigurationProperty(ConfigurationStrings.CheckCertificateRevocationList, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty dnsRefreshTimeout = new ConfigurationProperty(ConfigurationStrings.DnsRefreshTimeout, typeof(int), 2 * 60 * 1000, null, new TimeoutValidator(true), ConfigurationPropertyOptions.None); readonly ConfigurationProperty enableDnsRoundRobin = new ConfigurationProperty(ConfigurationStrings.EnableDnsRoundRobin, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty encryptionPolicy = new ConfigurationProperty(ConfigurationStrings.EncryptionPolicy, typeof(EncryptionPolicy), EncryptionPolicy.RequireEncryption, ConfigurationPropertyOptions.None); readonly ConfigurationProperty expect100Continue = new ConfigurationProperty(ConfigurationStrings.Expect100Continue, typeof(bool), true, ConfigurationPropertyOptions.None); readonly ConfigurationProperty useNagleAlgorithm = new ConfigurationProperty(ConfigurationStrings.UseNagleAlgorithm, typeof(bool), true, ConfigurationPropertyOptions.None); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Net.Security; using System.Reflection; using System.Security.Permissions; public sealed class ServicePointManagerElement : ConfigurationElement { public ServicePointManagerElement() { this.properties.Add(this.checkCertificateName); this.properties.Add(this.checkCertificateRevocationList); this.properties.Add(this.dnsRefreshTimeout); this.properties.Add(this.enableDnsRoundRobin); this.properties.Add(this.encryptionPolicy); this.properties.Add(this.expect100Continue); this.properties.Add(this.useNagleAlgorithm); } 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); } } } [ConfigurationProperty(ConfigurationStrings.CheckCertificateName, DefaultValue = true)] public bool CheckCertificateName { get { return (bool)this[this.checkCertificateName]; } set { this[this.checkCertificateName] = value; } } [ConfigurationProperty(ConfigurationStrings.CheckCertificateRevocationList, DefaultValue = false)] public bool CheckCertificateRevocationList { get { return (bool)this[this.checkCertificateRevocationList]; } set { this[this.checkCertificateRevocationList] = value; } } [ConfigurationProperty(ConfigurationStrings.DnsRefreshTimeout, DefaultValue = (int)( 2 * 60 * 1000))] public int DnsRefreshTimeout { get { return (int)this[this.dnsRefreshTimeout]; } set { this[this.dnsRefreshTimeout] = value; } } [ConfigurationProperty(ConfigurationStrings.EnableDnsRoundRobin, DefaultValue = false)] public bool EnableDnsRoundRobin { get { return (bool)this[this.enableDnsRoundRobin]; } set { this[this.enableDnsRoundRobin] = value; } } [ConfigurationProperty(ConfigurationStrings.EncryptionPolicy, DefaultValue = EncryptionPolicy.RequireEncryption)] public EncryptionPolicy EncryptionPolicy { get { return (EncryptionPolicy)this[this.encryptionPolicy]; } set { this[this.encryptionPolicy] = value; } } [ConfigurationProperty(ConfigurationStrings.Expect100Continue, DefaultValue = true)] public bool Expect100Continue { get { return (bool)this[this.expect100Continue]; } set { this[this.expect100Continue] = value; } } [ConfigurationProperty(ConfigurationStrings.UseNagleAlgorithm, DefaultValue=true)] public bool UseNagleAlgorithm { get { return (bool)this[this.useNagleAlgorithm]; } set { this[this.useNagleAlgorithm] = value; } } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty checkCertificateName = new ConfigurationProperty(ConfigurationStrings.CheckCertificateName, typeof(bool), true, ConfigurationPropertyOptions.None); readonly ConfigurationProperty checkCertificateRevocationList = new ConfigurationProperty(ConfigurationStrings.CheckCertificateRevocationList, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty dnsRefreshTimeout = new ConfigurationProperty(ConfigurationStrings.DnsRefreshTimeout, typeof(int), 2 * 60 * 1000, null, new TimeoutValidator(true), ConfigurationPropertyOptions.None); readonly ConfigurationProperty enableDnsRoundRobin = new ConfigurationProperty(ConfigurationStrings.EnableDnsRoundRobin, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty encryptionPolicy = new ConfigurationProperty(ConfigurationStrings.EncryptionPolicy, typeof(EncryptionPolicy), EncryptionPolicy.RequireEncryption, ConfigurationPropertyOptions.None); readonly ConfigurationProperty expect100Continue = new ConfigurationProperty(ConfigurationStrings.Expect100Continue, typeof(bool), true, ConfigurationPropertyOptions.None); readonly ConfigurationProperty useNagleAlgorithm = new ConfigurationProperty(ConfigurationStrings.UseNagleAlgorithm, typeof(bool), true, ConfigurationPropertyOptions.None); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FolderLevelBuildProvider.cs
- TextEndOfLine.cs
- ThreadAbortException.cs
- XhtmlBasicPageAdapter.cs
- OrderedDictionary.cs
- BinaryObjectReader.cs
- WebPartUtil.cs
- GlyphTypeface.cs
- TdsValueSetter.cs
- TemplateXamlTreeBuilder.cs
- View.cs
- MenuAutomationPeer.cs
- DataServiceQueryOfT.cs
- ExecutorLocksHeldException.cs
- AnnotationComponentChooser.cs
- LoadRetryHandler.cs
- XmlNodeChangedEventManager.cs
- DelegateBodyWriter.cs
- KeyValuePair.cs
- TemplateEditingVerb.cs
- ToolStripItemBehavior.cs
- TextMarkerSource.cs
- TransactionChannelFactory.cs
- CommandSet.cs
- ProcessHostConfigUtils.cs
- FormViewModeEventArgs.cs
- ArrayList.cs
- ConnectionConsumerAttribute.cs
- ProtocolsConfiguration.cs
- ProfileSettings.cs
- EventPrivateKey.cs
- TypeConstant.cs
- ModelServiceImpl.cs
- x509store.cs
- HtmlElementErrorEventArgs.cs
- EndpointDispatcher.cs
- DataGridViewColumnEventArgs.cs
- CopyCodeAction.cs
- RolePrincipal.cs
- NegationPusher.cs
- HighContrastHelper.cs
- VBCodeProvider.cs
- ToolStripLocationCancelEventArgs.cs
- SymbolTable.cs
- EntityContainer.cs
- XsdDataContractExporter.cs
- BamlRecordReader.cs
- XmlSchemaSubstitutionGroup.cs
- SemanticAnalyzer.cs
- ParenthesizePropertyNameAttribute.cs
- IxmlLineInfo.cs
- BaseServiceProvider.cs
- Popup.cs
- ComplusTypeValidator.cs
- LogSwitch.cs
- BoundColumn.cs
- FileFormatException.cs
- ProgressBar.cs
- OutputBuffer.cs
- HashSet.cs
- Request.cs
- ApplicationCommands.cs
- documentsequencetextview.cs
- PaintEvent.cs
- EventHandlersStore.cs
- ObjectSecurity.cs
- ControlCachePolicy.cs
- MsmqAppDomainProtocolHandler.cs
- SiteMapPath.cs
- StorageInfo.cs
- BitmapEffectDrawingContextState.cs
- TextParagraphProperties.cs
- EllipticalNodeOperations.cs
- IsolatedStorageException.cs
- RegexMatchCollection.cs
- StylusCollection.cs
- DataGridViewSelectedColumnCollection.cs
- EntityAdapter.cs
- HttpConfigurationContext.cs
- XmlText.cs
- figurelength.cs
- Process.cs
- MenuItemAutomationPeer.cs
- Point4DValueSerializer.cs
- ParseNumbers.cs
- COM2ExtendedTypeConverter.cs
- XPathNodePointer.cs
- BatchParser.cs
- ContractMethodInfo.cs
- XmlSchemaObjectTable.cs
- ClientRuntimeConfig.cs
- Table.cs
- SQLRoleProvider.cs
- RenderCapability.cs
- WebControl.cs
- hwndwrapper.cs
- DataConnectionHelper.cs
- RecognizedWordUnit.cs
- MergeFilterQuery.cs
- TransactionFormatter.cs