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
- HandlerWithFactory.cs
- XmlAttribute.cs
- SqlBinder.cs
- XmlObjectSerializerReadContext.cs
- XmlEventCache.cs
- WebPartAddingEventArgs.cs
- LogLogRecordEnumerator.cs
- SqlStream.cs
- ToolStripSplitStackLayout.cs
- XmlHierarchyData.cs
- mediaeventargs.cs
- AssemblyCollection.cs
- PreProcessInputEventArgs.cs
- CodeFieldReferenceExpression.cs
- EditorAttribute.cs
- SqlReorderer.cs
- MsmqBindingFilter.cs
- configsystem.cs
- DataGridViewTextBoxColumn.cs
- ApplicationDirectory.cs
- XmlSchemaImporter.cs
- EventSourceCreationData.cs
- ReadOnlyCollection.cs
- SiteMapSection.cs
- ResourceProviderFactory.cs
- ApplicationHost.cs
- SuppressMessageAttribute.cs
- XmlDataSourceNodeDescriptor.cs
- CoreChannel.cs
- CurrencyWrapper.cs
- TagNameToTypeMapper.cs
- XMLSyntaxException.cs
- CommandManager.cs
- RelationshipType.cs
- IgnoreFileBuildProvider.cs
- ToolStripProgressBar.cs
- SymmetricKeyWrap.cs
- XmlSerializationGeneratedCode.cs
- EntityDataSourceSelectedEventArgs.cs
- EnumerableRowCollectionExtensions.cs
- PropertyEntry.cs
- SharedUtils.cs
- Property.cs
- RecordBuilder.cs
- TypeSemantics.cs
- ProjectionRewriter.cs
- DataObjectPastingEventArgs.cs
- GetFileNameResult.cs
- httpstaticobjectscollection.cs
- MailDefinition.cs
- ProcessProtocolHandler.cs
- UpdateCompiler.cs
- ScriptingSectionGroup.cs
- PersonalizationAdministration.cs
- InstanceKey.cs
- OleDbFactory.cs
- WorkflowDesignerMessageFilter.cs
- ResourceSet.cs
- FileDialogCustomPlace.cs
- DefaultMemberAttribute.cs
- Stacktrace.cs
- HttpHandler.cs
- WebPartManagerInternals.cs
- TemplateControlParser.cs
- CommandHelper.cs
- CqlWriter.cs
- OrderPreservingPipeliningMergeHelper.cs
- MimeWriter.cs
- Simplifier.cs
- SerialPort.cs
- OdbcFactory.cs
- ImageAttributes.cs
- ControlIdConverter.cs
- GridViewRowPresenter.cs
- QueryCacheKey.cs
- ComMethodElementCollection.cs
- SqlFileStream.cs
- FileDetails.cs
- FrameworkContextData.cs
- InputReferenceExpression.cs
- WebResourceAttribute.cs
- ValidationErrorCollection.cs
- SoapTypeAttribute.cs
- _SecureChannel.cs
- PagesSection.cs
- OdbcReferenceCollection.cs
- EventQueueState.cs
- BlockCollection.cs
- HitTestParameters.cs
- LineSegment.cs
- SemanticResultKey.cs
- PropertyEmitterBase.cs
- SerializationTrace.cs
- DataGridViewRowsAddedEventArgs.cs
- DataGridViewLinkColumn.cs
- DBAsyncResult.cs
- FactoryGenerator.cs
- ProcessRequestArgs.cs
- WindowsRegion.cs
- HostedElements.cs