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
- HttpProfileBase.cs
- XmlNode.cs
- ArrayMergeHelper.cs
- QueryAsyncResult.cs
- PointLight.cs
- MarkupExtensionParser.cs
- TreeViewAutomationPeer.cs
- StateMachine.cs
- InputScope.cs
- TypeDescriptor.cs
- ActivityDesignerResources.cs
- CancelEventArgs.cs
- DataColumnSelectionConverter.cs
- _StreamFramer.cs
- XmlNamespaceManager.cs
- NumberFunctions.cs
- InvokeGenerator.cs
- LogLogRecordHeader.cs
- base64Transforms.cs
- ConnectionManagementSection.cs
- CustomAttribute.cs
- ChineseLunisolarCalendar.cs
- _CommandStream.cs
- FieldDescriptor.cs
- ThreadPoolTaskScheduler.cs
- RenderOptions.cs
- ProxyWebPartConnectionCollection.cs
- Pair.cs
- SpellerHighlightLayer.cs
- CompilationPass2TaskInternal.cs
- Clock.cs
- FixedSOMContainer.cs
- MessageEnumerator.cs
- dsa.cs
- HierarchicalDataSourceConverter.cs
- FlagsAttribute.cs
- TextRenderer.cs
- XamlTemplateSerializer.cs
- XmlQueryContext.cs
- ChameleonKey.cs
- grammarelement.cs
- UnmanagedBitmapWrapper.cs
- RelationshipSet.cs
- XmlQualifiedNameTest.cs
- DateTimeUtil.cs
- ContentFilePart.cs
- ItemAutomationPeer.cs
- SoapSchemaExporter.cs
- ProgressPage.cs
- ConstNode.cs
- UidManager.cs
- DataContractJsonSerializer.cs
- FacetChecker.cs
- TextSpan.cs
- SafeMarshalContext.cs
- CommentEmitter.cs
- InputQueue.cs
- ShaderRenderModeValidation.cs
- TriState.cs
- DictionaryManager.cs
- TagPrefixInfo.cs
- BaseTemplateCodeDomTreeGenerator.cs
- SecurityContext.cs
- DataSourceHelper.cs
- Process.cs
- securitycriticaldataformultiplegetandset.cs
- BinaryNode.cs
- FlowchartDesigner.Helpers.cs
- BasicHttpSecurity.cs
- ColumnHeaderCollectionEditor.cs
- TableRowCollection.cs
- ProxyManager.cs
- OleDbSchemaGuid.cs
- CalloutQueueItem.cs
- FigureHelper.cs
- OperationParameterInfoCollection.cs
- EqualityComparer.cs
- TargetInvocationException.cs
- RulePatternOps.cs
- DesigntimeLicenseContextSerializer.cs
- HtmlInputControl.cs
- ToolStripSplitStackLayout.cs
- SmtpFailedRecipientsException.cs
- SQLBytesStorage.cs
- WebPartEditVerb.cs
- AnimationClockResource.cs
- DefaultWorkflowTransactionService.cs
- TargetInvocationException.cs
- CompositeFontInfo.cs
- SQLSingle.cs
- CompositeCollection.cs
- Win32Exception.cs
- HtmlPageAdapter.cs
- XmlNullResolver.cs
- GenericWebPart.cs
- LinqDataSource.cs
- _Connection.cs
- ParallelEnumerable.cs
- TraceContextEventArgs.cs
- AuthenticationConfig.cs