Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / Configuration / ConnectionManagementElement.cs / 1 / ConnectionManagementElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Reflection; using System.Security.Permissions; public sealed class ConnectionManagementElement : ConfigurationElement { public ConnectionManagementElement() { this.properties.Add(this.address); this.properties.Add(this.maxconnection); } public ConnectionManagementElement(string address, int maxConnection) : this() { this.Address = address; this.MaxConnection = maxConnection; } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ConfigurationStrings.Address, IsRequired=true, IsKey = true)] public string Address { get { return (string)this[this.address]; } set { this[this.address] = value; } } [ConfigurationProperty(ConfigurationStrings.MaxConnection, IsRequired=true, DefaultValue=(int)1)] public int MaxConnection { get { return (int)this[this.maxconnection]; } set { this[this.maxconnection] = value; } } internal string Key { get { return this.Address; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty address = new ConfigurationProperty(ConfigurationStrings.Address, typeof(string), null, ConfigurationPropertyOptions.IsKey); // CODE REVIEWER: Should the default value here be int.MaxInt, 2, or something else? readonly ConfigurationProperty maxconnection = new ConfigurationProperty(ConfigurationStrings.MaxConnection, typeof(int), 1, 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.Reflection; using System.Security.Permissions; public sealed class ConnectionManagementElement : ConfigurationElement { public ConnectionManagementElement() { this.properties.Add(this.address); this.properties.Add(this.maxconnection); } public ConnectionManagementElement(string address, int maxConnection) : this() { this.Address = address; this.MaxConnection = maxConnection; } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } [ConfigurationProperty(ConfigurationStrings.Address, IsRequired=true, IsKey = true)] public string Address { get { return (string)this[this.address]; } set { this[this.address] = value; } } [ConfigurationProperty(ConfigurationStrings.MaxConnection, IsRequired=true, DefaultValue=(int)1)] public int MaxConnection { get { return (int)this[this.maxconnection]; } set { this[this.maxconnection] = value; } } internal string Key { get { return this.Address; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty address = new ConfigurationProperty(ConfigurationStrings.Address, typeof(string), null, ConfigurationPropertyOptions.IsKey); // CODE REVIEWER: Should the default value here be int.MaxInt, 2, or something else? readonly ConfigurationProperty maxconnection = new ConfigurationProperty(ConfigurationStrings.MaxConnection, typeof(int), 1, 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
- Table.cs
- XmlAttributeCollection.cs
- TempFiles.cs
- MessageDescriptionCollection.cs
- DrawingImage.cs
- ScrollBarRenderer.cs
- CodeTypeConstructor.cs
- TableRowCollection.cs
- StorageEndPropertyMapping.cs
- BitmapEffectInput.cs
- XPathNode.cs
- PersonalizationAdministration.cs
- LambdaCompiler.Unary.cs
- ListViewContainer.cs
- Mapping.cs
- ToolBarDesigner.cs
- UrlAuthorizationModule.cs
- WebPartMinimizeVerb.cs
- CapabilitiesAssignment.cs
- ProgressBarRenderer.cs
- AtomMaterializerLog.cs
- CollectionViewProxy.cs
- ObjectListGeneralPage.cs
- ManagementPath.cs
- MessageHeaderDescription.cs
- HttpBindingExtension.cs
- Ipv6Element.cs
- EdmConstants.cs
- PairComparer.cs
- ObjectPersistData.cs
- UITypeEditor.cs
- CodeTypeParameterCollection.cs
- FrameworkElementFactory.cs
- Int32KeyFrameCollection.cs
- Pipe.cs
- XmlSchemaFacet.cs
- ChtmlTextWriter.cs
- SchemaElement.cs
- XmlUtil.cs
- BufferedStream.cs
- ReflectionTypeLoadException.cs
- SR.cs
- TypeConvertions.cs
- XamlFigureLengthSerializer.cs
- CustomExpression.cs
- ContentPresenter.cs
- GenericEnumerator.cs
- SafePEFileHandle.cs
- ExpressionsCollectionConverter.cs
- ValueType.cs
- BatchParser.cs
- DataSourceNameHandler.cs
- XmlSchemaNotation.cs
- SafeEventLogWriteHandle.cs
- Slider.cs
- InvalidAsynchronousStateException.cs
- InvalidBodyAccessException.cs
- ListSourceHelper.cs
- mansign.cs
- HTMLTagNameToTypeMapper.cs
- ConnectionOrientedTransportBindingElement.cs
- InternalCache.cs
- MailBnfHelper.cs
- InternalDuplexChannelListener.cs
- DeclaredTypeValidatorAttribute.cs
- XmlEntityReference.cs
- UseAttributeSetsAction.cs
- SQLInt64.cs
- EntitySqlQueryBuilder.cs
- C14NUtil.cs
- DataGridViewCellConverter.cs
- AccessedThroughPropertyAttribute.cs
- GraphicsPath.cs
- DictionaryBase.cs
- ControlAdapter.cs
- DbResourceAllocator.cs
- CompilerGlobalScopeAttribute.cs
- AssemblyBuilder.cs
- HWStack.cs
- ImageDrawing.cs
- Marshal.cs
- DataGridBoundColumn.cs
- ViewCellSlot.cs
- BuildProviderUtils.cs
- DomainConstraint.cs
- PasswordRecovery.cs
- SettingsPropertyValueCollection.cs
- InternalSafeNativeMethods.cs
- BrushMappingModeValidation.cs
- WMIInterop.cs
- ClientScriptManager.cs
- SizeIndependentAnimationStorage.cs
- SchemaElementLookUpTableEnumerator.cs
- TextTreeText.cs
- List.cs
- FrameworkTextComposition.cs
- SoapBinding.cs
- CodeExpressionCollection.cs
- CatalogZone.cs
- ApplicationContext.cs