Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ColorBlend.cs
- XamlTypeMapper.cs
- LinqDataSourceInsertEventArgs.cs
- SiteMapNodeItem.cs
- WindowsListViewScroll.cs
- CheckBoxFlatAdapter.cs
- unsafenativemethodsother.cs
- IntSumAggregationOperator.cs
- CollectionBuilder.cs
- WebPartZoneBase.cs
- CheckBox.cs
- CodeArgumentReferenceExpression.cs
- SqlDataSourceEnumerator.cs
- odbcmetadatacollectionnames.cs
- ReaderWriterLock.cs
- XPathDocumentIterator.cs
- TypeConstant.cs
- QueryOptionExpression.cs
- GridViewDesigner.cs
- StdRegProviderWrapper.cs
- PermissionListSet.cs
- SR.cs
- StorageFunctionMapping.cs
- ToolBarPanel.cs
- Char.cs
- HtmlEncodedRawTextWriter.cs
- DataReaderContainer.cs
- CorrelationExtension.cs
- GridSplitter.cs
- HttpConfigurationSystem.cs
- CodeSnippetStatement.cs
- UpdatePanel.cs
- ChildTable.cs
- GlyphsSerializer.cs
- AuthenticationException.cs
- TargetControlTypeAttribute.cs
- AuthenticationService.cs
- PointHitTestResult.cs
- DataError.cs
- DoubleConverter.cs
- DoubleAnimationUsingKeyFrames.cs
- NativeMethodsCLR.cs
- Expressions.cs
- ConfigErrorGlyph.cs
- MulticastDelegate.cs
- OleDbErrorCollection.cs
- XhtmlTextWriter.cs
- BindToObject.cs
- TrailingSpaceComparer.cs
- FileSystemWatcher.cs
- SkinBuilder.cs
- SafeSecurityHelper.cs
- LinkLabel.cs
- MailSettingsSection.cs
- Hashtable.cs
- WsdlInspector.cs
- MetabaseServerConfig.cs
- TreeNodeStyle.cs
- MachinePropertyVariants.cs
- DataColumnCollection.cs
- HtmlMeta.cs
- HttpDebugHandler.cs
- NameValueSectionHandler.cs
- FacetEnabledSchemaElement.cs
- SystemTcpConnection.cs
- EncryptedData.cs
- SmiConnection.cs
- DragSelectionMessageFilter.cs
- DictionaryBase.cs
- SortableBindingList.cs
- RadioButtonDesigner.cs
- DataGridViewCellPaintingEventArgs.cs
- ConfigXmlAttribute.cs
- ConnectionInterfaceCollection.cs
- ChangeTracker.cs
- TextElementAutomationPeer.cs
- TimeSpanConverter.cs
- WebSysDisplayNameAttribute.cs
- XmlSchemaSubstitutionGroup.cs
- SerializationSectionGroup.cs
- RawStylusInputCustomData.cs
- ValidateNames.cs
- SmiGettersStream.cs
- SerializationBinder.cs
- MergeFailedEvent.cs
- TabletDevice.cs
- QuotedStringWriteStateInfo.cs
- SQLBinaryStorage.cs
- InternalMappingException.cs
- Transform.cs
- HierarchicalDataBoundControl.cs
- UnsafeNativeMethods.cs
- _OSSOCK.cs
- BrowserInteropHelper.cs
- ModuleBuilderData.cs
- ParagraphResult.cs
- DataGridTableStyleMappingNameEditor.cs
- PropertyGrid.cs
- SimpleBitVector32.cs
- SocketException.cs