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

  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:  IList
  18. **
  19. **
  20. ** Purpose: Base interface for all Lists.
  21. **
  22. **
  23. ===========================================================*/
  24. namespace System.Collections
  25. {
  26.    
  27.     using System;
  28.     // An IList is an ordered collection of objects. The exact ordering
  29.     // is up to the implementation of the list, ranging from a sorted
  30.     // order to insertion order.
  31.     [System.Runtime.InteropServices.ComVisible(true)]
  32.     public interface IList : ICollection
  33.     {
  34.         // Interfaces are not serializable
  35.         // The Item property provides methods to read and edit entries in the List.
  36.         object this[int index]
  37.         {
  38.             get;
  39.             set;
  40.         }
  41.        
  42.         // Adds an item to the list. The exact position in the list is
  43.         // implementation-dependent, so while ArrayList may always insert
  44.         // in the last available location, a SortedList most likely would not.
  45.         // The return value is the position the new element was inserted in.
  46.         int Add(object value);
  47.        
  48.         // Returns whether the list contains a particular item.
  49.         bool Contains(object value);
  50.        
  51.         // Removes all items from the list.
  52.         void Clear();
  53.        
  54.         bool IsReadOnly {
  55.             get;
  56.         }
  57.        
  58.        
  59.         bool IsFixedSize {
  60.             get;
  61.         }
  62.        
  63.        
  64.         // Returns the index of a particular item, if it is in the list.
  65.         // Returns -1 if the item isn't in the list.
  66.         int IndexOf(object value);
  67.        
  68.         // Inserts value into the list at position index.
  69.         // index must be non-negative and less than or equal to the
  70.         // number of elements in the list. If index equals the number
  71.         // of items in the list, then value is appended to the end.
  72.         void Insert(int index, object value);
  73.        
  74.         // Removes an item from the list.
  75.         void Remove(object value);
  76.        
  77.         // Removes the item at position index.
  78.         void RemoveAt(int index);
  79.     }
  80. }

Developer Fusion