Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / Configuration / ProxyElement.cs / 1 / 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);
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IntSecurity.cs
- DataGridViewControlCollection.cs
- ViewBase.cs
- Bold.cs
- BuildProvidersCompiler.cs
- ReachFixedDocumentSerializer.cs
- UmAlQuraCalendar.cs
- ObjectStateEntryDbDataRecord.cs
- DesignTimeData.cs
- WebPartMenuStyle.cs
- SecurityElement.cs
- DiagnosticsConfigurationHandler.cs
- CodeTypeMember.cs
- ValidationRule.cs
- storepermission.cs
- AttachedAnnotationChangedEventArgs.cs
- UseManagedPresentationBindingElementImporter.cs
- TypeConverterValueSerializer.cs
- DllNotFoundException.cs
- AssemblyBuilder.cs
- XmlProcessingInstruction.cs
- XmlSchemaException.cs
- RSAPKCS1SignatureDeformatter.cs
- PathNode.cs
- RemotingAttributes.cs
- NavigationCommands.cs
- VScrollProperties.cs
- ZoneLinkButton.cs
- ColorContext.cs
- LiteralControl.cs
- ErrorHandler.cs
- RelationalExpressions.cs
- EntryIndex.cs
- AstTree.cs
- NetworkInformationPermission.cs
- DateTimeFormatInfoScanner.cs
- OrderByBuilder.cs
- FillBehavior.cs
- TagMapCollection.cs
- ReadContentAsBinaryHelper.cs
- XsltConvert.cs
- ExtensibleClassFactory.cs
- VariantWrapper.cs
- CaseStatement.cs
- BinaryObjectWriter.cs
- CompareValidator.cs
- PropertyIDSet.cs
- XsltSettings.cs
- Guid.cs
- XmlAttribute.cs
- GacUtil.cs
- KeyInterop.cs
- WorkflowLayouts.cs
- AuthenticatedStream.cs
- ListBoxAutomationPeer.cs
- TypeHelpers.cs
- DataControlFieldCollection.cs
- TreeNodeStyleCollection.cs
- GradientSpreadMethodValidation.cs
- SendActivityValidator.cs
- MenuAutomationPeer.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XmlComment.cs
- LineBreakRecord.cs
- OrderByBuilder.cs
- XmlSerializationReader.cs
- PersonalizationEntry.cs
- TraceHandler.cs
- ByteAnimationUsingKeyFrames.cs
- DictionaryTraceRecord.cs
- ButtonPopupAdapter.cs
- _BufferOffsetSize.cs
- XsdDateTime.cs
- CodeBlockBuilder.cs
- StringInfo.cs
- PersistencePipeline.cs
- _PooledStream.cs
- CategoryAttribute.cs
- FileLevelControlBuilderAttribute.cs
- RbTree.cs
- HeaderUtility.cs
- ReflectPropertyDescriptor.cs
- Win32.cs
- ByteStorage.cs
- AuthenticationModuleElement.cs
- MetaTable.cs
- CacheOutputQuery.cs
- TabletDeviceInfo.cs
- DynamicValidator.cs
- PartitionerQueryOperator.cs
- XNodeValidator.cs
- IRCollection.cs
- RsaSecurityToken.cs
- DataGridViewComboBoxCell.cs
- DocumentPageTextView.cs
- DataGrid.cs
- RequestCacheValidator.cs
- WindowsEditBoxRange.cs
- CompilerGlobalScopeAttribute.cs
- DES.cs