Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SQLStringStorage.cs
- ThicknessAnimation.cs
- SpecialFolderEnumConverter.cs
- ServicePointManager.cs
- DataKeyCollection.cs
- Geometry3D.cs
- ColumnResizeAdorner.cs
- GCHandleCookieTable.cs
- IIS7UserPrincipal.cs
- AvTraceDetails.cs
- ToolStripPanelRow.cs
- DataKey.cs
- Annotation.cs
- ReadContentAsBinaryHelper.cs
- ListGeneralPage.cs
- COM2ComponentEditor.cs
- SchemaImporter.cs
- SessionIDManager.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SpellerInterop.cs
- CodeTryCatchFinallyStatement.cs
- RouteData.cs
- ValidationHelper.cs
- XmlSchemaSequence.cs
- WebColorConverter.cs
- ConstructorBuilder.cs
- AuthorizationContext.cs
- ListViewSortEventArgs.cs
- DocumentSequence.cs
- BamlRecordHelper.cs
- ECDsaCng.cs
- WebPartEventArgs.cs
- BorderGapMaskConverter.cs
- SchemaMapping.cs
- ValidationEventArgs.cs
- InvokeSchedule.cs
- ClientSettingsProvider.cs
- DataGridViewCellConverter.cs
- TableDetailsRow.cs
- MenuItemCollection.cs
- DecimalAnimationUsingKeyFrames.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ResetableIterator.cs
- ParallelTimeline.cs
- ClientTarget.cs
- TrackBar.cs
- StreamProxy.cs
- PersonalizationStateInfoCollection.cs
- DecimalFormatter.cs
- COMException.cs
- HtmlElementCollection.cs
- PngBitmapDecoder.cs
- WeakHashtable.cs
- DocumentAutomationPeer.cs
- ErrorCodes.cs
- AlphabeticalEnumConverter.cs
- SafeMILHandleMemoryPressure.cs
- ListItemCollection.cs
- HwndTarget.cs
- DataGridViewImageColumn.cs
- ApplicationServiceHelper.cs
- FileSystemInfo.cs
- NetTcpSecurityElement.cs
- Margins.cs
- ResumeStoryboard.cs
- EventSinkHelperWriter.cs
- HwndProxyElementProvider.cs
- SortKey.cs
- StandardOleMarshalObject.cs
- CryptoKeySecurity.cs
- ListArgumentProvider.cs
- TabPanel.cs
- LinqDataSource.cs
- DbDataAdapter.cs
- UseManagedPresentationElement.cs
- RepeaterCommandEventArgs.cs
- PnrpPeerResolver.cs
- WbmpConverter.cs
- EmptyControlCollection.cs
- EDesignUtil.cs
- NativeObjectSecurity.cs
- BindingContext.cs
- RelationshipSet.cs
- XPathDocument.cs
- Int32KeyFrameCollection.cs
- WrappedIUnknown.cs
- ToolStripPanelSelectionGlyph.cs
- CategoriesDocument.cs
- DesignerContextDescriptor.cs
- ProcessHost.cs
- IdnMapping.cs
- CurrentChangingEventArgs.cs
- TextPenaltyModule.cs
- _OSSOCK.cs
- SchemaInfo.cs
- grammarelement.cs
- DesignerCommandSet.cs
- OperationResponse.cs
- Int16Storage.cs
- HttpRequestWrapper.cs