Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / Configuration / WebProxyScriptElement.cs / 1 / WebProxyScriptElement.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Net.Configuration
{
using System;
using System.Configuration;
using System.Security.Permissions;
public sealed class WebProxyScriptElement : ConfigurationElement
{
public WebProxyScriptElement()
{
this.properties.Add(this.downloadTimeout);
/* Not used with Managed JScript
this.properties.Add(this.executionTimeout);
*/
}
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;
try {
ExceptionHelper.WebPermissionUnrestricted.Demand();
} catch (Exception exception) {
throw new ConfigurationErrorsException(
SR.GetString(SR.net_config_element_permission,
ConfigurationStrings.WebProxyScript),
exception);
}
}
[ConfigurationProperty(ConfigurationStrings.DownloadTimeout, DefaultValue = "00:02:00")]
public TimeSpan DownloadTimeout
{
get { return (TimeSpan) this[this.downloadTimeout]; }
set { this[this.downloadTimeout] = value; }
}
/* Not used with Managed JScript
[ConfigurationProperty(ConfigurationStrings.ExecutionTimeout, DefaultValue = "00:00:05")]
public TimeSpan ExecutionTimeout
{
get { return (TimeSpan) this[this.executionTimeout]; }
set { this[this.executionTimeout] = value; }
}
*/
protected override ConfigurationPropertyCollection Properties
{
get
{
return this.properties;
}
}
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
readonly ConfigurationProperty downloadTimeout =
new ConfigurationProperty(ConfigurationStrings.DownloadTimeout,
typeof(TimeSpan),
TimeSpan.FromMinutes(1),
ConfigurationPropertyOptions.None);
/* Not used with Managed JScript
readonly ConfigurationProperty executionTimeout =
new ConfigurationProperty(ConfigurationStrings.ExecutionTimeout,
typeof(TimeSpan),
TimeSpan.FromSeconds(5),
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.Security.Permissions;
public sealed class WebProxyScriptElement : ConfigurationElement
{
public WebProxyScriptElement()
{
this.properties.Add(this.downloadTimeout);
/* Not used with Managed JScript
this.properties.Add(this.executionTimeout);
*/
}
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;
try {
ExceptionHelper.WebPermissionUnrestricted.Demand();
} catch (Exception exception) {
throw new ConfigurationErrorsException(
SR.GetString(SR.net_config_element_permission,
ConfigurationStrings.WebProxyScript),
exception);
}
}
[ConfigurationProperty(ConfigurationStrings.DownloadTimeout, DefaultValue = "00:02:00")]
public TimeSpan DownloadTimeout
{
get { return (TimeSpan) this[this.downloadTimeout]; }
set { this[this.downloadTimeout] = value; }
}
/* Not used with Managed JScript
[ConfigurationProperty(ConfigurationStrings.ExecutionTimeout, DefaultValue = "00:00:05")]
public TimeSpan ExecutionTimeout
{
get { return (TimeSpan) this[this.executionTimeout]; }
set { this[this.executionTimeout] = value; }
}
*/
protected override ConfigurationPropertyCollection Properties
{
get
{
return this.properties;
}
}
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
readonly ConfigurationProperty downloadTimeout =
new ConfigurationProperty(ConfigurationStrings.DownloadTimeout,
typeof(TimeSpan),
TimeSpan.FromMinutes(1),
ConfigurationPropertyOptions.None);
/* Not used with Managed JScript
readonly ConfigurationProperty executionTimeout =
new ConfigurationProperty(ConfigurationStrings.ExecutionTimeout,
typeof(TimeSpan),
TimeSpan.FromSeconds(5),
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
- UnorderedHashRepartitionStream.cs
- HttpServerUtilityWrapper.cs
- recordstate.cs
- ParserStreamGeometryContext.cs
- BufferAllocator.cs
- MultiSelectRootGridEntry.cs
- GridViewCommandEventArgs.cs
- ScriptingRoleServiceSection.cs
- ForeignKeyConstraint.cs
- PropertyRef.cs
- WindowsToolbarItemAsMenuItem.cs
- ComboBox.cs
- TextBoxView.cs
- DataSourceSelectArguments.cs
- RequestQueue.cs
- XmlBinaryReader.cs
- GroupBox.cs
- NavigationWindow.cs
- XmlName.cs
- Win32.cs
- OracleRowUpdatingEventArgs.cs
- DataBindingExpressionBuilder.cs
- PublishLicense.cs
- StructuredTypeEmitter.cs
- SafeArchiveContext.cs
- MetadataHelper.cs
- GeometryConverter.cs
- TextBoxLine.cs
- COM2Properties.cs
- DataGridViewColumnConverter.cs
- EntityProviderServices.cs
- PKCS1MaskGenerationMethod.cs
- DatatypeImplementation.cs
- COM2PropertyDescriptor.cs
- ColumnMapCopier.cs
- AlignmentXValidation.cs
- NetCodeGroup.cs
- EnterpriseServicesHelper.cs
- ReadOnlyTernaryTree.cs
- ConnectionProviderAttribute.cs
- FontCollection.cs
- ZoneMembershipCondition.cs
- PersianCalendar.cs
- DesignConnection.cs
- SharedUtils.cs
- MessageQuerySet.cs
- TextSegment.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- XhtmlBasicCalendarAdapter.cs
- Vector3DValueSerializer.cs
- ColorDialog.cs
- PropertyGroupDescription.cs
- ConvertEvent.cs
- ProfilePropertyMetadata.cs
- IProvider.cs
- DesignerOptionService.cs
- FixedTextContainer.cs
- Int16Converter.cs
- VSWCFServiceContractGenerator.cs
- CacheAxisQuery.cs
- SQLGuid.cs
- ProfilePropertySettingsCollection.cs
- TypeRefElement.cs
- View.cs
- LinkedResourceCollection.cs
- XmlSchemaSimpleTypeUnion.cs
- CellLabel.cs
- ValueTypeFixupInfo.cs
- LiteralLink.cs
- ReferenceEqualityComparer.cs
- ExpressionBinding.cs
- StaticExtension.cs
- SpecialNameAttribute.cs
- SelectionRange.cs
- Highlights.cs
- HasCopySemanticsAttribute.cs
- ToolStripArrowRenderEventArgs.cs
- securitymgrsite.cs
- _ProxyChain.cs
- GZipStream.cs
- ExtendedPropertyDescriptor.cs
- StylusSystemGestureEventArgs.cs
- ToolStripGrip.cs
- XmlReflectionImporter.cs
- ThemeDictionaryExtension.cs
- DrawingAttributesDefaultValueFactory.cs
- DataGridViewLayoutData.cs
- ColorAnimationUsingKeyFrames.cs
- TextBreakpoint.cs
- Size3D.cs
- AutoResetEvent.cs
- SqlDataSourceCache.cs
- NumericUpDownAccelerationCollection.cs
- WebPartVerb.cs
- ColorInterpolationModeValidation.cs
- SqlInternalConnection.cs
- InvalidWMPVersionException.cs
- CharacterShapingProperties.cs
- LinkButton.cs
- ADConnectionHelper.cs