Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / ProxyElement.cs / 1305376 / ProxyElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Xml; using System.Configuration; using System.Reflection; using System.ComponentModel; using System.Security.Permissions; public sealed class ProxyElement : ConfigurationElement { public enum BypassOnLocalValues { Unspecified = -1, False = 0, True = 1, } public enum UseSystemDefaultValues { Unspecified = -1, False = 0, True = 1, } public enum AutoDetectValues { Unspecified = -1, False = 0, True = 1, } public ProxyElement() { this.properties.Add(this.autoDetect); this.properties.Add(this.scriptLocation); this.properties.Add(this.bypassonlocal); this.properties.Add(this.proxyaddress); this.properties.Add(this.usesystemdefault); } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ConfigurationStrings.AutoDetect, DefaultValue=AutoDetectValues.Unspecified)] public AutoDetectValues AutoDetect { get { return (AutoDetectValues)this[this.autoDetect]; } set { this[this.autoDetect] = value; } } [ConfigurationProperty(ConfigurationStrings.ScriptLocation)] public Uri ScriptLocation { get { return (Uri)this[this.scriptLocation]; } set { this[this.scriptLocation] = value; } } [ConfigurationProperty(ConfigurationStrings.BypassOnLocal, DefaultValue=(BypassOnLocalValues) BypassOnLocalValues.Unspecified)] public BypassOnLocalValues BypassOnLocal { get { return (BypassOnLocalValues) this[this.bypassonlocal]; } set { this[this.bypassonlocal] = value; } } [ConfigurationProperty(ConfigurationStrings.ProxyAddress)] public Uri ProxyAddress { get { return (Uri) this[this.proxyaddress]; } set { this[this.proxyaddress] = value; } } [ConfigurationProperty(ConfigurationStrings.UseSystemDefault, DefaultValue=(UseSystemDefaultValues) UseSystemDefaultValues.Unspecified)] public UseSystemDefaultValues UseSystemDefault { get { return (UseSystemDefaultValues)this[this.usesystemdefault]; } set { this[this.usesystemdefault] = value; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty autoDetect = new ConfigurationProperty(ConfigurationStrings.AutoDetect, typeof(AutoDetectValues), AutoDetectValues.Unspecified, new EnumConverter(typeof(AutoDetectValues)), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty scriptLocation = new ConfigurationProperty(ConfigurationStrings.ScriptLocation, typeof(Uri), null, new UriTypeConverter(UriKind.Absolute), null, ConfigurationPropertyOptions.None); // Supply a type converter, even though it's a plain type converter, to get around ConfigurationProperty's internal // Enum conversion routine. The internal one is case-sensitive, we want this to be case-insensitive. readonly ConfigurationProperty bypassonlocal = new ConfigurationProperty(ConfigurationStrings.BypassOnLocal, typeof(BypassOnLocalValues), BypassOnLocalValues.Unspecified, new EnumConverter(typeof(BypassOnLocalValues)), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty proxyaddress = new ConfigurationProperty(ConfigurationStrings.ProxyAddress, typeof(Uri), null, new UriTypeConverter(UriKind.Absolute), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty usesystemdefault = new ConfigurationProperty(ConfigurationStrings.UseSystemDefault, typeof(UseSystemDefaultValues), UseSystemDefaultValues.Unspecified, new EnumConverter(typeof(UseSystemDefaultValues)), null, 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.Xml; using System.Configuration; using System.Reflection; using System.ComponentModel; using System.Security.Permissions; public sealed class ProxyElement : ConfigurationElement { public enum BypassOnLocalValues { Unspecified = -1, False = 0, True = 1, } public enum UseSystemDefaultValues { Unspecified = -1, False = 0, True = 1, } public enum AutoDetectValues { Unspecified = -1, False = 0, True = 1, } public ProxyElement() { this.properties.Add(this.autoDetect); this.properties.Add(this.scriptLocation); this.properties.Add(this.bypassonlocal); this.properties.Add(this.proxyaddress); this.properties.Add(this.usesystemdefault); } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ConfigurationStrings.AutoDetect, DefaultValue=AutoDetectValues.Unspecified)] public AutoDetectValues AutoDetect { get { return (AutoDetectValues)this[this.autoDetect]; } set { this[this.autoDetect] = value; } } [ConfigurationProperty(ConfigurationStrings.ScriptLocation)] public Uri ScriptLocation { get { return (Uri)this[this.scriptLocation]; } set { this[this.scriptLocation] = value; } } [ConfigurationProperty(ConfigurationStrings.BypassOnLocal, DefaultValue=(BypassOnLocalValues) BypassOnLocalValues.Unspecified)] public BypassOnLocalValues BypassOnLocal { get { return (BypassOnLocalValues) this[this.bypassonlocal]; } set { this[this.bypassonlocal] = value; } } [ConfigurationProperty(ConfigurationStrings.ProxyAddress)] public Uri ProxyAddress { get { return (Uri) this[this.proxyaddress]; } set { this[this.proxyaddress] = value; } } [ConfigurationProperty(ConfigurationStrings.UseSystemDefault, DefaultValue=(UseSystemDefaultValues) UseSystemDefaultValues.Unspecified)] public UseSystemDefaultValues UseSystemDefault { get { return (UseSystemDefaultValues)this[this.usesystemdefault]; } set { this[this.usesystemdefault] = value; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty autoDetect = new ConfigurationProperty(ConfigurationStrings.AutoDetect, typeof(AutoDetectValues), AutoDetectValues.Unspecified, new EnumConverter(typeof(AutoDetectValues)), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty scriptLocation = new ConfigurationProperty(ConfigurationStrings.ScriptLocation, typeof(Uri), null, new UriTypeConverter(UriKind.Absolute), null, ConfigurationPropertyOptions.None); // Supply a type converter, even though it's a plain type converter, to get around ConfigurationProperty's internal // Enum conversion routine. The internal one is case-sensitive, we want this to be case-insensitive. readonly ConfigurationProperty bypassonlocal = new ConfigurationProperty(ConfigurationStrings.BypassOnLocal, typeof(BypassOnLocalValues), BypassOnLocalValues.Unspecified, new EnumConverter(typeof(BypassOnLocalValues)), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty proxyaddress = new ConfigurationProperty(ConfigurationStrings.ProxyAddress, typeof(Uri), null, new UriTypeConverter(UriKind.Absolute), null, ConfigurationPropertyOptions.None); readonly ConfigurationProperty usesystemdefault = new ConfigurationProperty(ConfigurationStrings.UseSystemDefault, typeof(UseSystemDefaultValues), UseSystemDefaultValues.Unspecified, new EnumConverter(typeof(UseSystemDefaultValues)), null, 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
- ThicknessConverter.cs
- ObjectResult.cs
- ExtendedPropertyDescriptor.cs
- DesignerRegion.cs
- StringExpressionSet.cs
- WebZoneDesigner.cs
- MetadataItemEmitter.cs
- HtmlInputReset.cs
- ReferenceEqualityComparer.cs
- RIPEMD160Managed.cs
- FormView.cs
- DictionaryEntry.cs
- InkCollectionBehavior.cs
- FixedSOMImage.cs
- ThreadPool.cs
- CharEnumerator.cs
- KeyMatchBuilder.cs
- XPathAncestorIterator.cs
- CancellationHandler.cs
- Expr.cs
- HttpFileCollection.cs
- PathParser.cs
- ColumnMapTranslator.cs
- LocationSectionRecord.cs
- DataGridViewImageColumn.cs
- ObjectDataSourceMethodEventArgs.cs
- IListConverters.cs
- HttpModuleCollection.cs
- TextViewBase.cs
- DependencyPropertyKind.cs
- Wizard.cs
- PermissionListSet.cs
- SymbolType.cs
- PageContentCollection.cs
- RequestCache.cs
- FileSystemInfo.cs
- RadioButtonAutomationPeer.cs
- AnnotationMap.cs
- ColumnPropertiesGroup.cs
- KeyManager.cs
- XmlLangPropertyAttribute.cs
- xmlfixedPageInfo.cs
- DefaultBindingPropertyAttribute.cs
- RegistrationServices.cs
- DecryptedHeader.cs
- TextDataBindingHandler.cs
- LoadedEvent.cs
- EntityTemplateUserControl.cs
- EditingCommands.cs
- NeutralResourcesLanguageAttribute.cs
- MergePropertyDescriptor.cs
- AuthenticationConfig.cs
- AssemblyGen.cs
- ChangeProcessor.cs
- ChameleonKey.cs
- Variable.cs
- GeometryConverter.cs
- WebPartZoneCollection.cs
- LoadItemsEventArgs.cs
- ScopelessEnumAttribute.cs
- CodeNamespaceImportCollection.cs
- DatatypeImplementation.cs
- WindowsListViewGroupSubsetLink.cs
- ComplexLine.cs
- EncryptedKey.cs
- OrthographicCamera.cs
- VoiceChangeEventArgs.cs
- DataGridViewColumn.cs
- HandlerBase.cs
- SecurityException.cs
- DashStyle.cs
- StringStorage.cs
- InstanceKeyCompleteException.cs
- TreeNodeBindingDepthConverter.cs
- TouchPoint.cs
- StopRoutingHandler.cs
- FtpCachePolicyElement.cs
- ScriptManagerProxy.cs
- DynamicActionMessageFilter.cs
- SecureEnvironment.cs
- BamlVersionHeader.cs
- NonSerializedAttribute.cs
- NavigationPropertyEmitter.cs
- RSAOAEPKeyExchangeFormatter.cs
- ComponentResourceKeyConverter.cs
- PageOutputQuality.cs
- FamilyCollection.cs
- BitmapEffectInputData.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- UnsafeNativeMethods.cs
- StatusBarItem.cs
- PagesSection.cs
- ComplexBindingPropertiesAttribute.cs
- XmlRootAttribute.cs
- SystemResourceKey.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- XmlUtil.cs
- WindowsGraphicsCacheManager.cs
- XsltSettings.cs
- SizeConverter.cs