Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- InternalSafeNativeMethods.cs
- PropertyEmitter.cs
- MenuItemAutomationPeer.cs
- WebRequest.cs
- BCryptNative.cs
- TextElementEnumerator.cs
- Query.cs
- DefinitionProperties.cs
- OptimisticConcurrencyException.cs
- PrimitiveDataContract.cs
- IPEndPointCollection.cs
- SemaphoreSecurity.cs
- AnnotationResource.cs
- isolationinterop.cs
- _Events.cs
- SchemaEntity.cs
- SynchronousReceiveElement.cs
- DbConvert.cs
- ResourceCategoryAttribute.cs
- TypeDelegator.cs
- DetailsViewPageEventArgs.cs
- WizardPanelChangingEventArgs.cs
- ModelItemCollectionImpl.cs
- TextTreeTextElementNode.cs
- PageFunction.cs
- ObjectManager.cs
- _LocalDataStoreMgr.cs
- PropertyKey.cs
- HttpApplication.cs
- HostingMessageProperty.cs
- XamlBuildTaskServices.cs
- MinMaxParagraphWidth.cs
- FileSystemEventArgs.cs
- ShapingWorkspace.cs
- XmlNamespaceDeclarationsAttribute.cs
- HtmlInputControl.cs
- HitTestDrawingContextWalker.cs
- PtsHost.cs
- Substitution.cs
- CaretElement.cs
- ConstraintManager.cs
- XsdCachingReader.cs
- ScrollItemPattern.cs
- CodeTypeReferenceExpression.cs
- RequestQueue.cs
- CrossSiteScriptingValidation.cs
- StaticContext.cs
- SystemIPv6InterfaceProperties.cs
- EntityConnectionStringBuilder.cs
- ConsoleTraceListener.cs
- NumberAction.cs
- CodeNamespaceCollection.cs
- OLEDB_Util.cs
- FileDialog_Vista_Interop.cs
- DataGridState.cs
- WebFormsRootDesigner.cs
- WindowsBrush.cs
- ExcludeFromCodeCoverageAttribute.cs
- WindowsGraphics.cs
- QueueException.cs
- BooleanKeyFrameCollection.cs
- MenuItem.cs
- EntityKey.cs
- AnimationException.cs
- GetTokenRequest.cs
- SiteMapDataSourceView.cs
- CancelAsyncOperationRequest.cs
- HttpTransportElement.cs
- DataColumnMapping.cs
- GraphicsPath.cs
- FlatButtonAppearance.cs
- ResourceDisplayNameAttribute.cs
- DesignTimeData.cs
- TextEditorLists.cs
- IProducerConsumerCollection.cs
- MouseEvent.cs
- DataFormats.cs
- CookielessHelper.cs
- ExtensionQuery.cs
- _HelperAsyncResults.cs
- ComponentDispatcherThread.cs
- InputGestureCollection.cs
- ClockGroup.cs
- WizardPanel.cs
- ColumnResizeAdorner.cs
- DesignerSerializationOptionsAttribute.cs
- SchemaLookupTable.cs
- XmlTypeAttribute.cs
- WrappedReader.cs
- BinaryWriter.cs
- ProfileService.cs
- CreateDataSourceDialog.cs
- NavigateEvent.cs
- TypeGeneratedEventArgs.cs
- X509CertificateTrustedIssuerElement.cs
- Transform3D.cs
- ManagedWndProcTracker.cs
- SearchForVirtualItemEventArgs.cs
- ApplicationSecurityManager.cs
- SyntaxCheck.cs