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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ConfigurationManagerHelperFactory.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.    
  18.     using System.Configuration.Internal;
  19.     using System.Security.Permissions;
  20.    
  21.     //
  22.     // class ConfigurationManagerHelperFactory manages access to a
  23.     // single instance of ConfigurationManagerHelper.
  24.     //
  25.     static internal class ConfigurationManagerHelperFactory
  26.     {
  27.         private const string ConfigurationManagerHelperTypeString = "System.Configuration.Internal.ConfigurationManagerHelper, " + AssemblyRef.System;
  28.        
  29.         private static IConfigurationManagerHelper s_instance;
  30.        
  31.         static internal IConfigurationManagerHelper Instance {
  32.             get {
  33.                 if (s_instance == null) {
  34.                     s_instance = (IConfigurationManagerHelper)TypeUtil.CreateInstanceWithReflectionPermission(ConfigurationManagerHelperTypeString);
  35.                 }
  36.                
  37.                 return s_instance;
  38.             }
  39.         }
  40.     }
  41. }

Developer Fusion