Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / ConnectionManagementSection.cs / 1305376 / ConnectionManagementSection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Net.Configuration
{
using System.Configuration;
using System.Collections;
using System.Threading;
public sealed class ConnectionManagementSection : ConfigurationSection
{
public ConnectionManagementSection()
{
this.properties.Add(this.connectionManagement);
}
[ConfigurationProperty("", IsDefaultCollection = true)]
public ConnectionManagementElementCollection ConnectionManagement
{
get { return (ConnectionManagementElementCollection)this[this.connectionManagement]; }
}
protected override ConfigurationPropertyCollection Properties
{
get { return this.properties; }
}
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
readonly ConfigurationProperty connectionManagement =
new ConfigurationProperty(null, typeof(ConnectionManagementElementCollection), null,
ConfigurationPropertyOptions.IsDefaultCollection);
}
internal sealed class ConnectionManagementSectionInternal
{
internal ConnectionManagementSectionInternal(ConnectionManagementSection section)
{
if (section.ConnectionManagement.Count > 0)
{
this.connectionManagement = new Hashtable(section.ConnectionManagement.Count);
foreach(ConnectionManagementElement connectionManagementElement in section.ConnectionManagement)
{
this.connectionManagement[connectionManagementElement.Address] = connectionManagementElement.MaxConnection;
}
}
}
internal Hashtable ConnectionManagement
{
get
{
Hashtable retval = this.connectionManagement;
if (retval == null)
{
retval = new Hashtable();
}
return retval;
}
}
internal static object ClassSyncObject
{
get
{
if (classSyncObject == null)
{
object o = new object();
Interlocked.CompareExchange(ref classSyncObject, o, null);
}
return classSyncObject;
}
}
static internal ConnectionManagementSectionInternal GetSection()
{
lock (ConnectionManagementSectionInternal.ClassSyncObject)
{
ConnectionManagementSection section = PrivilegedConfigurationManager.GetSection(ConfigurationStrings.ConnectionManagementSectionPath) as ConnectionManagementSection;
if (section == null)
return null;
return new ConnectionManagementSectionInternal(section);
}
}
Hashtable connectionManagement = null;
static object classSyncObject = null;
}
}
// 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
- TableTextElementCollectionInternal.cs
- IUnknownConstantAttribute.cs
- HttpCapabilitiesEvaluator.cs
- AppDomainCompilerProxy.cs
- UdpDuplexChannel.cs
- SimpleHandlerBuildProvider.cs
- StreamAsIStream.cs
- SecuritySessionClientSettings.cs
- DbExpressionBuilder.cs
- HttpProfileBase.cs
- UpdateDelegates.Generated.cs
- RowsCopiedEventArgs.cs
- SocketAddress.cs
- CompositeCollectionView.cs
- DataGridViewLinkColumn.cs
- PrePostDescendentsWalker.cs
- ContainerControl.cs
- HttpCookieCollection.cs
- Membership.cs
- LayoutEngine.cs
- httpserverutility.cs
- WebFormDesignerActionService.cs
- Stream.cs
- NumericUpDownAccelerationCollection.cs
- GlyphsSerializer.cs
- FocusWithinProperty.cs
- IFormattable.cs
- DBCSCodePageEncoding.cs
- SamlAssertionKeyIdentifierClause.cs
- IgnoreDataMemberAttribute.cs
- x509utils.cs
- DetailsViewUpdatedEventArgs.cs
- LinkButton.cs
- FlowNode.cs
- ScopeCollection.cs
- InvokeBinder.cs
- DrawItemEvent.cs
- _StreamFramer.cs
- Vector.cs
- SqlRowUpdatingEvent.cs
- _FixedSizeReader.cs
- Stopwatch.cs
- PropertyEmitter.cs
- AuthenticationServiceManager.cs
- RoutedEventValueSerializer.cs
- AdapterDictionary.cs
- NavigatorInput.cs
- HMACSHA1.cs
- SubclassTypeValidatorAttribute.cs
- ClientEndpointLoader.cs
- LoginCancelEventArgs.cs
- StretchValidation.cs
- Int16AnimationUsingKeyFrames.cs
- ByteArrayHelperWithString.cs
- DispatcherFrame.cs
- ConfigurationProperty.cs
- TextParentUndoUnit.cs
- ClientFormsIdentity.cs
- Parameter.cs
- WindowsStatic.cs
- Hyperlink.cs
- NativeMethods.cs
- XmlDomTextWriter.cs
- ConstrainedGroup.cs
- PropertyRecord.cs
- SchemaElementDecl.cs
- SimpleMailWebEventProvider.cs
- DesignObjectWrapper.cs
- ImpersonateTokenRef.cs
- ScriptManagerProxy.cs
- Stylesheet.cs
- RightsManagementResourceHelper.cs
- BooleanToVisibilityConverter.cs
- EdmEntityTypeAttribute.cs
- Camera.cs
- XPathNavigatorReader.cs
- SlotInfo.cs
- SatelliteContractVersionAttribute.cs
- ProfessionalColorTable.cs
- HandlerBase.cs
- AttachmentCollection.cs
- DataMisalignedException.cs
- ReadOnlyNameValueCollection.cs
- SafeRsaProviderHandle.cs
- DeviceContext2.cs
- ScriptManagerProxy.cs
- LocatorPart.cs
- SQLDecimal.cs
- AssertValidation.cs
- EdmEntityTypeAttribute.cs
- DesignOnlyAttribute.cs
- DateTimeOffsetStorage.cs
- DurableInstanceContextProvider.cs
- DurableInstancingOptions.cs
- ContentWrapperAttribute.cs
- FormConverter.cs
- TextEditorTyping.cs
- GlyphElement.cs
- NativeMethods.cs
- Enum.cs