The Labs \ Source Viewer \ SSCLI \ System.Configuration \ ConnectionStringsSection

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ConnectionStringsSection.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.Configuration
  16. {
  17.     using System;
  18.     using System.Xml;
  19.     using System.Configuration;
  20.     using System.Collections.Specialized;
  21.     using System.Collections;
  22.     using System.IO;
  23.     using System.Text;
  24.    
  25.     public sealed class ConnectionStringsSection : ConfigurationSection
  26.     {
  27.         private static ConfigurationPropertyCollection _properties;
  28.         private static readonly ConfigurationProperty _propConnectionStrings = new ConfigurationProperty(null, typeof(ConnectionStringSettingsCollection), null, ConfigurationPropertyOptions.IsDefaultCollection);
  29.        
  30.         static ConnectionStringsSection()
  31.         {
  32.             // Property initialization
  33.             _properties = new ConfigurationPropertyCollection();
  34.             _properties.Add(_propConnectionStrings);
  35.         }
  36.        
  37.         public ConnectionStringsSection()
  38.         {
  39.         }
  40.        
  41.         protected internal override object GetRuntimeObject()
  42.         {
  43.             SetReadOnly();
  44.             return this;
  45.             // return the read only object
  46.         }
  47.        
  48.         protected internal override ConfigurationPropertyCollection Properties {
  49.             get { return _properties; }
  50.         }
  51.        
  52.         [ConfigurationProperty("", Options = ConfigurationPropertyOptions.IsDefaultCollection)]
  53.         public ConnectionStringSettingsCollection ConnectionStrings {
  54.             get { return (ConnectionStringSettingsCollection)base[_propConnectionStrings]; }
  55.         }
  56.     }
  57. }

Developer Fusion