Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Net / System / Net / Configuration / ServicePointManagerElement.cs / 1 / ServicePointManagerElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; 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.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.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 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.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.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.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 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
- ListParagraph.cs
- GenericTextProperties.cs
- WorkingDirectoryEditor.cs
- ThaiBuddhistCalendar.cs
- InvalidEnumArgumentException.cs
- XmlSchemaComplexContentExtension.cs
- Image.cs
- ExpandSegment.cs
- ExceptionUtility.cs
- EntityDataSourceStatementEditorForm.cs
- DefaultWorkflowSchedulerService.cs
- NCryptNative.cs
- OverlappedAsyncResult.cs
- ProgressBar.cs
- JsonFormatMapping.cs
- LinearKeyFrames.cs
- Trace.cs
- MessageBox.cs
- StreamWriter.cs
- TypedTableBaseExtensions.cs
- ValidatedControlConverter.cs
- AuthorizationRuleCollection.cs
- MemoryMappedViewStream.cs
- TrackingConditionCollection.cs
- TextRangeEditTables.cs
- EdmToObjectNamespaceMap.cs
- GAC.cs
- WeakKeyDictionary.cs
- XPathExpr.cs
- Queue.cs
- StylusPointCollection.cs
- XPathExpr.cs
- HiddenField.cs
- AssociationTypeEmitter.cs
- VarInfo.cs
- errorpatternmatcher.cs
- Transform.cs
- HeaderLabel.cs
- DecoderBestFitFallback.cs
- XAMLParseException.cs
- IdnElement.cs
- PasswordDeriveBytes.cs
- PartBasedPackageProperties.cs
- ReliableInputConnection.cs
- SimpleTypeResolver.cs
- MailDefinition.cs
- InitializingNewItemEventArgs.cs
- TripleDES.cs
- SqlDataReader.cs
- ElementProxy.cs
- NetWebProxyFinder.cs
- CodeMemberEvent.cs
- IndentedTextWriter.cs
- Rotation3DAnimationBase.cs
- SafeRegistryHandle.cs
- AutomationTextAttribute.cs
- BitmapEffectRenderDataResource.cs
- WebBrowserNavigatedEventHandler.cs
- AnimationStorage.cs
- RowSpanVector.cs
- ReachDocumentPageSerializer.cs
- JournalNavigationScope.cs
- DynamicMetaObjectBinder.cs
- ScalarConstant.cs
- AttributeCollection.cs
- TextContainer.cs
- EncodingInfo.cs
- WebPartCancelEventArgs.cs
- SoundPlayerAction.cs
- UTF32Encoding.cs
- TableColumn.cs
- UdpSocketReceiveManager.cs
- ProfileModule.cs
- TextPatternIdentifiers.cs
- WaitForChangedResult.cs
- FieldNameLookup.cs
- GZipStream.cs
- ThreadStateException.cs
- DependencyPropertyDescriptor.cs
- UnsafeNativeMethods.cs
- TextModifierScope.cs
- ImageFormat.cs
- FixedStringLookup.cs
- SelectionHighlightInfo.cs
- SlipBehavior.cs
- NullableDoubleMinMaxAggregationOperator.cs
- DataSourceProvider.cs
- Size3D.cs
- LinqDataSource.cs
- safesecurityhelperavalon.cs
- TreeViewImageIndexConverter.cs
- StreamWithDictionary.cs
- FixedBufferAttribute.cs
- mactripleDES.cs
- FunctionParameter.cs
- TileModeValidation.cs
- WithParamAction.cs
- PageTheme.cs
- BinaryUtilClasses.cs
- Error.cs