Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ICollection<(Of <(T>)>) Interface

Updated: November 2007

Defines methods to manipulate generic collections.

Namespace:  System.Collections.Generic
Assembly:  mscorlib (in mscorlib.dll)

Visual Basic (Declaration)
Public Interface ICollection(Of T) _
    Implements IEnumerable(Of T), IEnumerable
Visual Basic (Usage)
Dim instance As ICollection(Of T)
C#
public interface ICollection<T> : IEnumerable<T>, 
    IEnumerable
Visual C++
generic<typename T>
public interface class ICollection : IEnumerable<T>, 
    IEnumerable
J#
J# supports the use of generic APIs, but not the declaration of new ones.
JScript
JScript does not support generic types or methods.

Type Parameters

T

The type of the elements in the collection.

The ICollection<(Of <(T>)>) interface is the base interface for classes in the System.Collections.Generic namespace.

The ICollection<(Of <(T>)>) interface extends IEnumerable<(Of <(T>)>); IDictionary<(Of <(TKey, TValue>)>) and IList<(Of <(T>)>) are more specialized interfaces that extend ICollection<(Of <(T>)>). A IDictionary<(Of <(TKey, TValue>)>) implementation is a collection of key/value pairs, like the Dictionary<(Of <(TKey, TValue>)>) class. A IList<(Of <(T>)>) implementation is a collection of values, and its members can be accessed by index, like the List<(Of <(T>)>) class.

Some collections that limit access to their elements, like the Queue<(Of <(T>)>) class and the Stack<(Of <(T>)>) class, directly implement the ICollection<(Of <(T>)>) interface.

If neither the IDictionary<(Of <(TKey, TValue>)>) interface nor the IList<(Of <(T>)>) interface meet the requirements of the required collection, derive the new collection class from the ICollection<(Of <(T>)>) interface instead for more flexibility.

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

.NET Compact Framework

Supported in: 3.5, 2.0

XNA Framework

Supported in: 2.0, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker