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
- Hash.cs
- XAMLParseException.cs
- BezierSegment.cs
- ConfigXmlWhitespace.cs
- TableChangeProcessor.cs
- PageThemeCodeDomTreeGenerator.cs
- SelectionWordBreaker.cs
- FixedPage.cs
- KeysConverter.cs
- CorrelationHandle.cs
- sortedlist.cs
- SubclassTypeValidatorAttribute.cs
- SystemIPInterfaceProperties.cs
- SiteMapNodeItem.cs
- InputProviderSite.cs
- ByteAnimation.cs
- BamlRecords.cs
- SuppressMergeCheckAttribute.cs
- FixedPageStructure.cs
- MethodCallConverter.cs
- XPathAncestorIterator.cs
- CompositeControl.cs
- ValueType.cs
- CultureInfoConverter.cs
- SequentialUshortCollection.cs
- WebPartMenu.cs
- SqlDataRecord.cs
- CompoundFileIOPermission.cs
- ShaderRenderModeValidation.cs
- Schema.cs
- XomlDesignerLoader.cs
- ValidationError.cs
- Transform.cs
- EntityDesignerDataSourceView.cs
- PageVisual.cs
- ChineseLunisolarCalendar.cs
- EmptyQuery.cs
- WebPartEditorOkVerb.cs
- PopupEventArgs.cs
- Animatable.cs
- NonSerializedAttribute.cs
- IDispatchConstantAttribute.cs
- TextFormatter.cs
- Rights.cs
- AmbientLight.cs
- BulletedList.cs
- StorageTypeMapping.cs
- SetState.cs
- BinHexDecoder.cs
- AnnotationComponentChooser.cs
- ArglessEventHandlerProxy.cs
- DataGridTextColumn.cs
- XmlSerializerAssemblyAttribute.cs
- MouseGestureConverter.cs
- PlatformCulture.cs
- CodeGenerator.cs
- ReflectionUtil.cs
- NumericUpDownAccelerationCollection.cs
- Vector3DCollectionConverter.cs
- ViewKeyConstraint.cs
- ViewEvent.cs
- GridViewDeletedEventArgs.cs
- CheckBox.cs
- DataRelationCollection.cs
- AssemblyHelper.cs
- ChtmlTextWriter.cs
- NumberSubstitution.cs
- BitmapEffectDrawingContextState.cs
- Expander.cs
- BaseCodeDomTreeGenerator.cs
- HighlightVisual.cs
- PerformanceCounterManager.cs
- Clause.cs
- Properties.cs
- SortFieldComparer.cs
- SystemGatewayIPAddressInformation.cs
- WebPartConnectionsEventArgs.cs
- AllMembershipCondition.cs
- TypeCollectionDesigner.xaml.cs
- XomlCompilerParameters.cs
- DragEvent.cs
- ListViewInsertionMark.cs
- Frame.cs
- ZipPackagePart.cs
- SoapHttpTransportImporter.cs
- StrongNameUtility.cs
- XmlAnyElementAttributes.cs
- SqlServices.cs
- KeyManager.cs
- Control.cs
- GridViewUpdatedEventArgs.cs
- input.cs
- MailSettingsSection.cs
- AsyncCallback.cs
- WebPartCloseVerb.cs
- OdbcHandle.cs
- HtmlEncodedRawTextWriter.cs
- ParserOptions.cs
- OAVariantLib.cs
- FaultPropagationQuery.cs