Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / ConnectionManagementElement.cs / 1305376 / 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
- PageDeviceFont.cs
- ToolStripDropDown.cs
- WmlSelectionListAdapter.cs
- RepeaterItemEventArgs.cs
- ClientBuildManagerCallback.cs
- SerializationAttributes.cs
- DoubleLink.cs
- StreamResourceInfo.cs
- RawStylusInputReport.cs
- HtmlProps.cs
- TemplateKeyConverter.cs
- XmlEntity.cs
- GlyphCache.cs
- TemplateBindingExtension.cs
- AsyncCompletedEventArgs.cs
- MenuItemCollection.cs
- localization.cs
- WebPartMenuStyle.cs
- StateMachineDesignerPaint.cs
- SqlGatherConsumedAliases.cs
- oledbmetadatacolumnnames.cs
- coordinatorfactory.cs
- PartitionerStatic.cs
- DataGridViewLayoutData.cs
- MorphHelpers.cs
- GridSplitter.cs
- VirtualizingPanel.cs
- TlsnegoTokenProvider.cs
- CustomAttributeFormatException.cs
- Page.cs
- CompositeScriptReferenceEventArgs.cs
- OrderedDictionaryStateHelper.cs
- RawMouseInputReport.cs
- SharedPersonalizationStateInfo.cs
- FormsAuthenticationUser.cs
- CardSpaceSelector.cs
- CodeMemberEvent.cs
- EdmItemCollection.cs
- Main.cs
- AttributeEmitter.cs
- RegistryPermission.cs
- DerivedKeySecurityToken.cs
- SHA1.cs
- x509utils.cs
- TextEditorSpelling.cs
- safesecurityhelperavalon.cs
- Rotation3DAnimationBase.cs
- RuntimeIdentifierPropertyAttribute.cs
- Tokenizer.cs
- EngineSiteSapi.cs
- OleDbMetaDataFactory.cs
- _LocalDataStoreMgr.cs
- MimeTypeAttribute.cs
- Tokenizer.cs
- OperationInvokerBehavior.cs
- DataBoundControlAdapter.cs
- MultiSelector.cs
- XsltConvert.cs
- embossbitmapeffect.cs
- SiteMapDataSource.cs
- DataControlExtensions.cs
- IISMapPath.cs
- XmlSerializationWriter.cs
- _NTAuthentication.cs
- FilteredSchemaElementLookUpTable.cs
- Convert.cs
- UnknownBitmapEncoder.cs
- ResourceAssociationType.cs
- GridPattern.cs
- dataprotectionpermission.cs
- ScriptHandlerFactory.cs
- QueryOptionExpression.cs
- LinearGradientBrush.cs
- IPHostEntry.cs
- RectConverter.cs
- PackagingUtilities.cs
- ObjectTag.cs
- BitmapEffectInput.cs
- TableCellCollection.cs
- BaseDataBoundControl.cs
- SoapIncludeAttribute.cs
- AspCompat.cs
- AutomationEventArgs.cs
- BuildProviderCollection.cs
- PointCollectionValueSerializer.cs
- PeerToPeerException.cs
- SecurityManager.cs
- XmlSchemaImport.cs
- ToolStripContainer.cs
- LinearGradientBrush.cs
- RouteParser.cs
- _PooledStream.cs
- DataSourceSelectArguments.cs
- MethodBuilder.cs
- documentsequencetextview.cs
- ToolStripComboBox.cs
- OracleBinary.cs
- Panel.cs
- COM2ExtendedUITypeEditor.cs
- IsolatedStorageFileStream.cs