Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- SubqueryTrackingVisitor.cs
- DateTimeValueSerializerContext.cs
- HtmlLink.cs
- Duration.cs
- DeclarativeCatalogPart.cs
- SystemTcpStatistics.cs
- XhtmlBasicLiteralTextAdapter.cs
- SqlProfileProvider.cs
- base64Transforms.cs
- ConversionValidationRule.cs
- XhtmlCssHandler.cs
- GridEntryCollection.cs
- TypeSystemHelpers.cs
- AutomationIdentifier.cs
- QilCloneVisitor.cs
- WorkItem.cs
- XMLSyntaxException.cs
- WebResponse.cs
- WebServiceResponse.cs
- ClientUtils.cs
- FrameworkElement.cs
- recordstate.cs
- AstTree.cs
- UnauthorizedAccessException.cs
- AuthenticatingEventArgs.cs
- SharedDp.cs
- ToggleButtonAutomationPeer.cs
- SqlCacheDependencyDatabase.cs
- HierarchicalDataSourceConverter.cs
- ActivityBindForm.cs
- MappingException.cs
- Subtree.cs
- BoundColumn.cs
- VideoDrawing.cs
- WindowsHyperlink.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- RedistVersionInfo.cs
- ExtensibleClassFactory.cs
- PerformanceCounterCategory.cs
- Image.cs
- ModifierKeysValueSerializer.cs
- XmlTypeAttribute.cs
- Typography.cs
- SqlMethodAttribute.cs
- RequestCacheValidator.cs
- FormatConvertedBitmap.cs
- ISAPIApplicationHost.cs
- XPathMultyIterator.cs
- RuntimeArgumentHandle.cs
- LicenseContext.cs
- ObjectDataSourceStatusEventArgs.cs
- XmlReturnReader.cs
- TrackPointCollection.cs
- Model3DGroup.cs
- Confirm.cs
- ResXResourceReader.cs
- TargetInvocationException.cs
- HashHelper.cs
- TraceUtils.cs
- SiteMapHierarchicalDataSourceView.cs
- ReadOnlyDictionary.cs
- FilteredXmlReader.cs
- Stack.cs
- ExpressionParser.cs
- BaseUriHelper.cs
- Documentation.cs
- datacache.cs
- TextAction.cs
- DashStyle.cs
- XmlTextReaderImplHelpers.cs
- NominalTypeEliminator.cs
- DocumentReference.cs
- ReflectEventDescriptor.cs
- ReferenceConverter.cs
- OdbcErrorCollection.cs
- ScriptReferenceBase.cs
- ToolStripArrowRenderEventArgs.cs
- SafeCloseHandleCritical.cs
- XslTransform.cs
- XmlQueryContext.cs
- HwndHostAutomationPeer.cs
- HasCopySemanticsAttribute.cs
- ViewPort3D.cs
- SqlDependency.cs
- ConcurrentStack.cs
- SiteMapHierarchicalDataSourceView.cs
- SmtpNegotiateAuthenticationModule.cs
- DetailsViewInsertedEventArgs.cs
- Rectangle.cs
- PropertyGridDesigner.cs
- EventLogEntry.cs
- DrawingContextDrawingContextWalker.cs
- Point.cs
- AutomationPatternInfo.cs
- NotifyParentPropertyAttribute.cs
- X509PeerCertificateAuthentication.cs
- ProjectionPlanCompiler.cs
- XappLauncher.cs
- Fonts.cs
- Misc.cs