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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ConfigurationElementCollectionType.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. using System;
  16. using System.Collections;
  17. using System.Xml;
  18. namespace System.Configuration
  19. {
  20.    
  21.     public enum ConfigurationElementCollectionType
  22.     {
  23. /**********************************************************************
  24.         This enum type specifies the behavior of the ConfigurationElementCollection.
  25.         Some of the behavior is changeable via other properties (i.e. throwing
  26.         on duplicate entries).
  27.         - BasicMap and BasicMapAlternate
  28.           This collection doesn't do any "clear" or "remove".  Whatever the set
  29.           of entries is in the config file is given back to the user.  An example
  30.           would be like Authentication Users, where each entry specifies a user.
  31.           The Alternate version of this collection simply changes the index location
  32.           of the items from the parent collection.  For example, suppose you had
  33.           entries in machine and app level specified like this:
  34.               machine.config  => A, B, C
  35.               web.config      => D, E, F
  36.           For BasicMap, the collection at the app level would be:
  37.                       A, B, C, D, E, F
  38.           With BasicMapAlternate, it'd be:
  39.                       D, E, F, A, B, C
  40.           That means that the Alternate allows the "nearest" config file entries to
  41.           take precedence over the "parent" config file entries. 
  42.         - AddRemoveClearMap and AddRemoveClearMapAlternate
  43.           This collection honors the "add, remove, clear" commands.  Internally it
  44.           keeps track of each of them so that it knows whether it has to write out
  45.           an add/remove/clear at the appropriate levels, so it uses a concept of
  46.           "virtual index" and "real index" to keep track of stuff.  The "virtual index"
  47.           is what the end user would see and use.  The "real index" is just for us.
  48.           Any access via indexes have to go through some transformation step.
  49.           The Alternate version changes the inheritance stuff like the BasicMapAlternate,
  50.           where the "nearest" config file entries take precendence over the "parent"
  51.           config file entries (see example above).
  52.         **********************************************************************/       
  53.        
  54.         BasicMap,
  55.         AddRemoveClearMap,
  56.         BasicMapAlternate,
  57.         AddRemoveClearMapAlternate
  58.     }
  59. }

Developer Fusion