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
- UidManager.cs
- PropertyInformation.cs
- AppSettingsExpressionBuilder.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ComboBoxAutomationPeer.cs
- QueryAccessibilityHelpEvent.cs
- RoleGroupCollection.cs
- Constraint.cs
- HitTestWithPointDrawingContextWalker.cs
- ReadOnlyNameValueCollection.cs
- Stylus.cs
- SrgsRuleRef.cs
- DataSetUtil.cs
- TileBrush.cs
- PathFigure.cs
- WindowInteropHelper.cs
- DynamicValueConverter.cs
- SafeFileMappingHandle.cs
- ManagementInstaller.cs
- WindowsTreeView.cs
- DateTimeValueSerializerContext.cs
- ActivationServices.cs
- UseManagedPresentationBindingElementImporter.cs
- altserialization.cs
- XmlSerializer.cs
- Stackframe.cs
- RadioButtonStandardAdapter.cs
- XmlLangPropertyAttribute.cs
- ApplicationSecurityManager.cs
- XPathMultyIterator.cs
- ResourceCategoryAttribute.cs
- Regex.cs
- safemediahandle.cs
- Set.cs
- SafeArrayRankMismatchException.cs
- QuestionEventArgs.cs
- XmlUrlEditor.cs
- ReflectionUtil.cs
- ProtocolsConfiguration.cs
- CodeExpressionRuleDeclaration.cs
- RadioButton.cs
- OracleBoolean.cs
- StrongName.cs
- DesignerVerbCollection.cs
- XPathNavigatorReader.cs
- FixedSchema.cs
- Label.cs
- CrossContextChannel.cs
- DataGridColumnHeaderAutomationPeer.cs
- XmlSchemaSequence.cs
- FontNamesConverter.cs
- WinEventHandler.cs
- PtsContext.cs
- CancellationTokenRegistration.cs
- GeneralTransform3DCollection.cs
- SendActivityValidator.cs
- BinaryMethodMessage.cs
- CodeMemberProperty.cs
- FixedSOMElement.cs
- MdiWindowListStrip.cs
- SharedPersonalizationStateInfo.cs
- XsltSettings.cs
- RegexNode.cs
- SubstitutionList.cs
- DrawingDrawingContext.cs
- UnsettableComboBox.cs
- FileStream.cs
- CompositeFontParser.cs
- BaseDataListPage.cs
- XmlILAnnotation.cs
- XmlSerializer.cs
- ProtocolImporter.cs
- XmlSchemaValidationException.cs
- FieldNameLookup.cs
- BitmapFrameDecode.cs
- PageRequestManager.cs
- Polygon.cs
- X509Utils.cs
- HttpApplication.cs
- PathParser.cs
- ProcessHost.cs
- TextBoxLine.cs
- KeyGestureValueSerializer.cs
- Base64Decoder.cs
- ProcessInfo.cs
- EditorPartCollection.cs
- ObjectDataSourceView.cs
- Path.cs
- SQLChars.cs
- XmlName.cs
- AnonymousIdentificationModule.cs
- _WinHttpWebProxyDataBuilder.cs
- CodeAccessPermission.cs
- TextDecorationUnitValidation.cs
- SamlNameIdentifierClaimResource.cs
- ResourceContainer.cs
- FormViewDeleteEventArgs.cs
- HostingEnvironment.cs
- XmlBinaryReader.cs
- PermissionSetEnumerator.cs