Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / WebProxyScriptElement.cs / 1305376 / 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:01: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),
null,
new TimeSpanValidator(new TimeSpan(0, 0, 0), TimeSpan.MaxValue, false),
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
- SupportingTokenChannel.cs
- DrawingContextDrawingContextWalker.cs
- IndicFontClient.cs
- MobileControlDesigner.cs
- DBConnectionString.cs
- XmlQualifiedName.cs
- SqlDataSourceSelectingEventArgs.cs
- Root.cs
- HashHelper.cs
- QilXmlWriter.cs
- TextRangeEditTables.cs
- Padding.cs
- DbXmlEnabledProviderManifest.cs
- CallbackHandler.cs
- TraceHwndHost.cs
- SafeNativeMethods.cs
- DiagnosticTraceSource.cs
- StructuredType.cs
- ParagraphVisual.cs
- SystemIcons.cs
- EventMappingSettingsCollection.cs
- Helpers.cs
- ScriptReferenceEventArgs.cs
- NetNamedPipeBindingElement.cs
- DataGridRelationshipRow.cs
- RegionData.cs
- _NegoState.cs
- UriExt.cs
- EllipseGeometry.cs
- MailSettingsSection.cs
- OleDbSchemaGuid.cs
- ForeignKeyConstraint.cs
- QueryIntervalOp.cs
- SamlAuthorityBinding.cs
- EntityTypeEmitter.cs
- ContentElementCollection.cs
- SolidColorBrush.cs
- Color.cs
- elementinformation.cs
- IsolatedStorageFile.cs
- MemoryFailPoint.cs
- LabelAutomationPeer.cs
- GeneralEndpointIdentity.cs
- SqlDataSource.cs
- MissingManifestResourceException.cs
- DBConnectionString.cs
- BoolExpressionVisitors.cs
- SequenceQuery.cs
- TextDecorationCollection.cs
- figurelengthconverter.cs
- Thread.cs
- BuilderPropertyEntry.cs
- ScrollViewer.cs
- COM2Properties.cs
- ApplyTemplatesAction.cs
- BinaryParser.cs
- TrackBarDesigner.cs
- ObjectTypeMapping.cs
- ExpressionBuilderContext.cs
- RSAOAEPKeyExchangeFormatter.cs
- SiteIdentityPermission.cs
- PlanCompiler.cs
- VectorCollectionConverter.cs
- SchemaTableColumn.cs
- BamlVersionHeader.cs
- ConnectionStringsExpressionBuilder.cs
- EntityDataSourceContextCreatedEventArgs.cs
- HashCodeCombiner.cs
- AuthenticationModuleElement.cs
- Image.cs
- ExtenderControl.cs
- PagePropertiesChangingEventArgs.cs
- WorkflowRuntimeServiceElement.cs
- XPathSelectionIterator.cs
- SecurityManager.cs
- MetadataFile.cs
- SocketCache.cs
- IndexOutOfRangeException.cs
- CancellationState.cs
- DuplexClientBase.cs
- CacheOutputQuery.cs
- CodeSubDirectory.cs
- BreakSafeBase.cs
- InvokeProviderWrapper.cs
- UpdateRecord.cs
- EmptyCollection.cs
- AnnotationElement.cs
- SemaphoreFullException.cs
- WSFederationHttpBindingCollectionElement.cs
- RadioButtonList.cs
- CodeThrowExceptionStatement.cs
- ImageList.cs
- DataGridViewCellStateChangedEventArgs.cs
- PropertyEmitter.cs
- ParameterCollection.cs
- CodeGroup.cs
- SqlBulkCopyColumnMapping.cs
- XPathArrayIterator.cs
- DelayedRegex.cs
- AuthenticationSection.cs