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
- SiteMapNodeItemEventArgs.cs
- DataGridItemEventArgs.cs
- BuilderPropertyEntry.cs
- RegexWorker.cs
- RuleElement.cs
- XsltException.cs
- ValidationEventArgs.cs
- ListBase.cs
- X509ChainElement.cs
- SqlBooleanMismatchVisitor.cs
- TreeNodeCollection.cs
- DragEventArgs.cs
- NavigationProperty.cs
- ThreadStaticAttribute.cs
- GeneralTransform3D.cs
- QilParameter.cs
- OracleColumn.cs
- RoutedUICommand.cs
- ToolStripMenuItemDesigner.cs
- SelectionWordBreaker.cs
- QuaternionRotation3D.cs
- ConsoleEntryPoint.cs
- Matrix.cs
- CodeDomLoader.cs
- ObjectDataSourceSelectingEventArgs.cs
- Directory.cs
- ISAPIApplicationHost.cs
- DesignerHelpers.cs
- hwndwrapper.cs
- UpdateTracker.cs
- SchemaMerger.cs
- DocumentScope.cs
- BlurEffect.cs
- CombinedGeometry.cs
- UniqueEventHelper.cs
- DiagnosticsConfigurationHandler.cs
- HttpModuleCollection.cs
- InlineCollection.cs
- PrintPreviewDialog.cs
- BufferBuilder.cs
- TextEditorSpelling.cs
- BatchParser.cs
- EntityChangedParams.cs
- UIElementParaClient.cs
- CreateUserWizard.cs
- DetailsViewDeleteEventArgs.cs
- SqlUtil.cs
- ThreadStartException.cs
- SqlDuplicator.cs
- XmlHierarchicalDataSourceView.cs
- XmlFormatExtensionPointAttribute.cs
- WindowsTokenRoleProvider.cs
- Encoder.cs
- Misc.cs
- SqlError.cs
- WebProxyScriptElement.cs
- RelationshipEndCollection.cs
- SafeHandle.cs
- QuaternionIndependentAnimationStorage.cs
- FileAuthorizationModule.cs
- FileCodeGroup.cs
- DoubleAnimationBase.cs
- _SslSessionsCache.cs
- CompilerScope.Storage.cs
- TerminatorSinks.cs
- OleDbRowUpdatingEvent.cs
- _SslStream.cs
- MachineKey.cs
- PathSegmentCollection.cs
- Brush.cs
- TransformerInfoCollection.cs
- TdsParserSafeHandles.cs
- TreeSet.cs
- WsdlBuildProvider.cs
- PnrpPermission.cs
- Delegate.cs
- PropertyGridEditorPart.cs
- XmlAutoDetectWriter.cs
- DirtyTextRange.cs
- TiffBitmapDecoder.cs
- Int16AnimationBase.cs
- Bold.cs
- EncoderReplacementFallback.cs
- ContextStaticAttribute.cs
- NameScopePropertyAttribute.cs
- DefaultSection.cs
- SafeEventLogReadHandle.cs
- HtmlButton.cs
- InstanceCreationEditor.cs
- ItemsPresenter.cs
- DnsPermission.cs
- WorkflowMessageEventArgs.cs
- XamlTypeMapperSchemaContext.cs
- WebServiceParameterData.cs
- CompiledRegexRunner.cs
- ThicknessConverter.cs
- XmlSchemaComplexContentExtension.cs
- JsonQueryStringConverter.cs
- Mapping.cs
- RegularExpressionValidator.cs