Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- CAGDesigner.cs
- FormViewInsertEventArgs.cs
- EntityDesignerBuildProvider.cs
- StructuredTypeEmitter.cs
- RegexNode.cs
- OleDbErrorCollection.cs
- FormDocumentDesigner.cs
- DesignerFrame.cs
- XNodeValidator.cs
- ContentValidator.cs
- odbcmetadatacolumnnames.cs
- ButtonBase.cs
- FixedBufferAttribute.cs
- HyperLinkStyle.cs
- TouchesCapturedWithinProperty.cs
- TabControlToolboxItem.cs
- StreamResourceInfo.cs
- VoiceChangeEventArgs.cs
- MemberRelationshipService.cs
- DataGridViewCellValueEventArgs.cs
- ExponentialEase.cs
- PropertyKey.cs
- MultiPropertyDescriptorGridEntry.cs
- ResourceSet.cs
- DynamicContractTypeBuilder.cs
- ImageListStreamer.cs
- SqlGatherConsumedAliases.cs
- AggregatePushdown.cs
- SystemIcmpV6Statistics.cs
- DataGridRow.cs
- TreeNodeCollection.cs
- Rights.cs
- UrlPath.cs
- PropertyPathConverter.cs
- GreenMethods.cs
- CompleteWizardStep.cs
- GenericUriParser.cs
- ViewStateModeByIdAttribute.cs
- TreePrinter.cs
- ISAPIApplicationHost.cs
- OleDbCommand.cs
- FigureParaClient.cs
- GenericUI.cs
- DocumentPageTextView.cs
- AlphaSortedEnumConverter.cs
- DependencyPropertyKey.cs
- ProfileProvider.cs
- ApplicationHost.cs
- BaseUriHelper.cs
- FastEncoderWindow.cs
- XsltQilFactory.cs
- FileChangesMonitor.cs
- DBCSCodePageEncoding.cs
- UpDownEvent.cs
- Compiler.cs
- RectangleF.cs
- ComponentChangingEvent.cs
- UnsafeNativeMethods.cs
- PublishLicense.cs
- CodeComment.cs
- FontFamily.cs
- TypeSemantics.cs
- TransformerInfo.cs
- TranslateTransform.cs
- PointValueSerializer.cs
- DataTableMappingCollection.cs
- Configuration.cs
- WpfMemberInvoker.cs
- AndCondition.cs
- PerformanceCounterLib.cs
- WebPartTransformerAttribute.cs
- ThousandthOfEmRealPoints.cs
- ResourcePool.cs
- DataGridCommandEventArgs.cs
- TransformerInfoCollection.cs
- HttpModuleActionCollection.cs
- AnimationTimeline.cs
- GraphicsPathIterator.cs
- HttpBindingExtension.cs
- SystemDropShadowChrome.cs
- BinaryObjectWriter.cs
- PenContext.cs
- TraceSection.cs
- RepeaterItemCollection.cs
- Helper.cs
- ProtocolsConfiguration.cs
- LayoutEngine.cs
- Qualifier.cs
- ImageSource.cs
- DataGridColumnCollection.cs
- MethodInfo.cs
- Sentence.cs
- CallInfo.cs
- DocumentSchemaValidator.cs
- ItemsControl.cs
- Nullable.cs
- MediaSystem.cs
- UserPreferenceChangedEventArgs.cs
- ServiceContractListItem.cs
- WorkflowShape.cs