The Labs \ Source Viewer \ SSCLI \ System.Collections \ IDictionary

  1. // ==++==
  2. //
  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. //
  14. // ==--==
  15. /*============================================================
  16. **
  17. ** Interface:  IDictionary
  18. **
  19. **
  20. ** Purpose: Base interface for all dictionaries.
  21. **
  22. **
  23. ===========================================================*/
  24. namespace System.Collections
  25. {
  26.     using System;
  27.    
  28.     // An IDictionary is a possibly unordered set of key-value pairs.
  29.     // Keys can be any non-null object. Values can be any object.
  30.     // You can look up a value in an IDictionary via the default indexed
  31.     // property, Items.
  32.     [System.Runtime.InteropServices.ComVisible(true)]
  33.     public interface IDictionary : ICollection
  34.     {
  35.         // Interfaces are not serializable
  36.         // The Item property provides methods to read and edit entries
  37.         // in the Dictionary.
  38.         object this[object key]
  39.         {
  40.             get;
  41.             set;
  42.         }
  43.        
  44.         // Returns a collections of the keys in this dictionary.
  45.         ICollection Keys {
  46.             get;
  47.         }
  48.        
  49.         // Returns a collections of the values in this dictionary.
  50.         ICollection Values {
  51.             get;
  52.         }
  53.        
  54.         // Returns whether this dictionary contains a particular key.
  55.         //
  56.         bool Contains(object key);
  57.        
  58.         // Adds a key-value pair to the dictionary.
  59.         //
  60.         void Add(object key, object value);
  61.        
  62.         // Removes all pairs from the dictionary.
  63.         void Clear();
  64.        
  65.         bool IsReadOnly {
  66.             get;
  67.         }
  68.        
  69.         bool IsFixedSize {
  70.             get;
  71.         }
  72.        
  73.         // Returns an IDictionaryEnumerator for this dictionary.
  74.         new IDictionaryEnumerator GetEnumerator();
  75.        
  76.         // Removes a particular key from the dictionary.
  77.         //
  78.         void Remove(object key);
  79.     }
  80. }

Developer Fusion