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
- HtmlButton.cs
- MdImport.cs
- PartialList.cs
- XmlCharType.cs
- DNS.cs
- Types.cs
- HelpPage.cs
- GridEntryCollection.cs
- ElementHost.cs
- CompositeScriptReferenceEventArgs.cs
- ContractBase.cs
- ByteStorage.cs
- ThreadStateException.cs
- FactoryMaker.cs
- SystemIPInterfaceStatistics.cs
- WorkflowRuntimeSection.cs
- CheckBox.cs
- EventArgs.cs
- ScaleTransform3D.cs
- TextSelectionProcessor.cs
- SyndicationSerializer.cs
- TypeCodeDomSerializer.cs
- SystemNetHelpers.cs
- SectionRecord.cs
- SamlConditions.cs
- CodeMemberEvent.cs
- SmtpAuthenticationManager.cs
- ExpressionsCollectionConverter.cs
- ScrollBarAutomationPeer.cs
- ObjectStateManagerMetadata.cs
- COAUTHINFO.cs
- WebPartDescriptionCollection.cs
- ProfileGroupSettings.cs
- ContainerControl.cs
- FaultCode.cs
- BitmapPalettes.cs
- ISAPIWorkerRequest.cs
- ToolboxItemFilterAttribute.cs
- RenderData.cs
- ThemeDirectoryCompiler.cs
- EventProviderWriter.cs
- SmtpException.cs
- Utils.cs
- RadioButtonPopupAdapter.cs
- HierarchicalDataTemplate.cs
- StringFreezingAttribute.cs
- LogEntryHeaderv1Deserializer.cs
- ResourceDescriptionAttribute.cs
- DetailsViewInsertedEventArgs.cs
- SecurityTokenValidationException.cs
- ClientRolePrincipal.cs
- InstalledFontCollection.cs
- DataGridViewTopLeftHeaderCell.cs
- PieceNameHelper.cs
- SoapAttributeOverrides.cs
- AttributeCollection.cs
- MethodCallTranslator.cs
- ToolTipAutomationPeer.cs
- ContextProperty.cs
- TrailingSpaceComparer.cs
- ChildTable.cs
- MonthCalendarDesigner.cs
- DSACryptoServiceProvider.cs
- ConfigsHelper.cs
- TimeIntervalCollection.cs
- RandomNumberGenerator.cs
- NameValueSectionHandler.cs
- ClientSponsor.cs
- AuthStoreRoleProvider.cs
- XmlAttributeAttribute.cs
- StandardTransformFactory.cs
- _BasicClient.cs
- StorageAssociationTypeMapping.cs
- ProjectionPath.cs
- HttpMethodAttribute.cs
- WindowsSecurityTokenAuthenticator.cs
- FreezableCollection.cs
- ByteStorage.cs
- SupportingTokenAuthenticatorSpecification.cs
- DeploymentSectionCache.cs
- Serializer.cs
- Psha1DerivedKeyGenerator.cs
- ConstantCheck.cs
- _DomainName.cs
- AdCreatedEventArgs.cs
- XmlHelper.cs
- ObjectIDGenerator.cs
- CodeGotoStatement.cs
- TemplateBindingExtensionConverter.cs
- CryptoKeySecurity.cs
- DataGridViewRowHeaderCell.cs
- Model3D.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- EncoderParameters.cs
- ImageClickEventArgs.cs
- DummyDataSource.cs
- Int16AnimationUsingKeyFrames.cs
- WindowsTitleBar.cs
- __Filters.cs
- ScrollProperties.cs