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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IConfigurationSectionHandler.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.     // The IConfigSectionHandler interface defines the contract that all configuration
  19.     // section handlers must implement in order to participate in the resolution of
  20.     // configuration settings.
  21.     //
  22.     // Composes and creates config objects.
  23.     //
  24.     // This interface is implemented by config providers.
  25.     // Classes implementing IConfigSectionHandler define the rules for cooking
  26.     // XML config into usable objects. The cooked objects
  27.     // can be of arbitrary type.
  28.     //
  29.     // Configuration is composable (e.g., config in a child
  30.     // directory is layered over config in a parent directory),
  31.     // so, IConfigSectionHandler is supplied with the parent config
  32.     // as well as any number of XML fragments.
  33.     public interface IConfigurationSectionHandler
  34.     {
  35.        
  36.         // Create
  37.         //
  38.         // @param parent the object inherited from parent path
  39.         // @param context reserved, in ASP.NET used to convey virtual path of config being evaluated
  40.         // @param section the xml node rooted at the section to handle
  41.         // @returns a new config object
  42.         //
  43.         // The function is responsible for inspecting "section", "context",
  44.         // and "parent", and creating a config object.
  45.         //
  46.         // Note that "parent" is guaranteed to be an object that
  47.         // was returned from a Create call on the same IConfigSectionHandler
  48.         // implementation. (E.g., if Create returns a Hashtable,
  49.         // then "parent" is always a Hashtable if it's non-null.)
  50.         //
  51.         // Returned objects must be immutable. In particular,
  52.         // it's important that the "parent" object being passed
  53.         // in is not altered: if a modification must be made,
  54.         // then it must be cloned before it is modified.
  55.         object Create(object parent, object configContext, System.Xml.XmlNode section);
  56.        
  57.     }
  58. }

Developer Fusion