The Labs \ Source Viewer \ SSCLI \ System.Configuration.Internal \ ConfigSystem

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ConfigSystem.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.Internal
  16. {
  17.     using System;
  18.     using System.Configuration;
  19.    
  20.     // The runtime config system
  21.     internal class ConfigSystem : IConfigSystem
  22.     {
  23.         IInternalConfigRoot _configRoot;
  24.         IInternalConfigHost _configHost;
  25.        
  26.         void IConfigSystem.Init(Type typeConfigHost, params object[] hostInitParams)
  27.         {
  28.             _configRoot = new InternalConfigRoot();
  29.             _configHost = (IInternalConfigHost)TypeUtil.CreateInstanceWithReflectionPermission(typeConfigHost);
  30.            
  31.             _configRoot.Init(_configHost, false);
  32.             _configHost.Init(_configRoot, hostInitParams);
  33.         }
  34.        
  35.         IInternalConfigHost IConfigSystem.Host {
  36.             get { return _configHost; }
  37.         }
  38.        
  39.         IInternalConfigRoot IConfigSystem.Root {
  40.             get { return _configRoot; }
  41.         }
  42.     }
  43. }

Developer Fusion