Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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);
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PerformanceCounterManager.cs
- GetWinFXPath.cs
- ThreadStateException.cs
- RadioButton.cs
- DataQuery.cs
- RepeaterCommandEventArgs.cs
- SafeTokenHandle.cs
- SecurityContext.cs
- ReaderOutput.cs
- Composition.cs
- Content.cs
- datacache.cs
- CompositeCollectionView.cs
- DataServiceRequestException.cs
- RelatedView.cs
- RegexReplacement.cs
- SafeThreadHandle.cs
- RotationValidation.cs
- OdbcHandle.cs
- MailDefinition.cs
- TimerElapsedEvenArgs.cs
- SqlDependency.cs
- AsymmetricSignatureDeformatter.cs
- BinaryReader.cs
- CqlGenerator.cs
- StrongNamePublicKeyBlob.cs
- UniqueEventHelper.cs
- TextBoxRenderer.cs
- TrustSection.cs
- DataSourceCacheDurationConverter.cs
- ZoomPercentageConverter.cs
- DataGridViewCheckBoxCell.cs
- EmptyStringExpandableObjectConverter.cs
- BamlBinaryReader.cs
- ChannelManager.cs
- ModelTreeEnumerator.cs
- EntryPointNotFoundException.cs
- parserscommon.cs
- AnimationClock.cs
- EntityDataSource.cs
- DetailsViewModeEventArgs.cs
- ListViewAutomationPeer.cs
- XmlSchemaResource.cs
- MULTI_QI.cs
- ListManagerBindingsCollection.cs
- CompositeDataBoundControl.cs
- MethodCallExpression.cs
- LogLogRecordHeader.cs
- ProjectionCamera.cs
- MediaScriptCommandRoutedEventArgs.cs
- ScrollBarRenderer.cs
- XmlDomTextWriter.cs
- WebPartTracker.cs
- HttpRequest.cs
- SafeSecurityHelper.cs
- PersistenceTypeAttribute.cs
- OleDbErrorCollection.cs
- SharedStatics.cs
- WindowsImpersonationContext.cs
- UnsafeNativeMethods.cs
- TdsParserHelperClasses.cs
- EntityContainer.cs
- GeneralTransformCollection.cs
- PageAdapter.cs
- WebSysDisplayNameAttribute.cs
- FrameworkElement.cs
- WindowsImpersonationContext.cs
- HttpWriter.cs
- QilLoop.cs
- RoutedUICommand.cs
- Effect.cs
- AttachedPropertyBrowsableAttribute.cs
- CultureInfoConverter.cs
- XsltConvert.cs
- Atom10ItemFormatter.cs
- NonNullItemCollection.cs
- MenuItemBindingCollection.cs
- ErrorRuntimeConfig.cs
- ProviderConnectionPointCollection.cs
- PrimitiveDataContract.cs
- RichTextBox.cs
- Token.cs
- CodeTypeMember.cs
- TextEditorLists.cs
- DataGridViewLayoutData.cs
- ObjectResult.cs
- AtomServiceDocumentSerializer.cs
- ConfigurationPropertyAttribute.cs
- SqlDataSourceSelectingEventArgs.cs
- TableStyle.cs
- ListItemConverter.cs
- WebServiceMethodData.cs
- LinearQuaternionKeyFrame.cs
- OdbcConnection.cs
- ToolboxItem.cs
- LeaseManager.cs
- ConfigXmlComment.cs
- InputScope.cs
- CultureInfoConverter.cs
- SqlProcedureAttribute.cs