diff options
Diffstat (limited to 'src/mscorlib/shared/System/Collections/Generic/IList.cs')
-rw-r--r-- | src/mscorlib/shared/System/Collections/Generic/IList.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Collections/Generic/IList.cs b/src/mscorlib/shared/System/Collections/Generic/IList.cs new file mode 100644 index 0000000000..43d6659da9 --- /dev/null +++ b/src/mscorlib/shared/System/Collections/Generic/IList.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Diagnostics.Contracts; + +namespace System.Collections.Generic +{ + // An IList is an ordered collection of objects. The exact ordering + // is up to the implementation of the list, ranging from a sorted + // order to insertion order. + public interface IList<T> : ICollection<T> + { + // The Item property provides methods to read and edit entries in the List. + T this[int index] + { + get; + set; + } + + // Returns the index of a particular item, if it is in the list. + // Returns -1 if the item isn't in the list. + int IndexOf(T item); + + // Inserts value into the list at position index. + // index must be non-negative and less than or equal to the + // number of elements in the list. If index equals the number + // of items in the list, then value is appended to the end. + void Insert(int index, T item); + + // Removes the item at position index. + void RemoveAt(int index); + } +} |