Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 1 rated this helpful - Rate this topic

Creating and Manipulating Collections

The most common collections are provided by the .NET Framework. You can use any of them or create your own collection based on one of them. Each collection is designed for specific purposes. The members included in each System.Collections class reflect the purpose of the collection. In addition, the generic collections in System.Collections.Generic make it easy to create strongly typed collections.

If you decide to implement your own collection, use the following guidelines:

  • Start with the right base class and interfaces. See Selecting a Collection Class for tips on how to choose a collection type.

  • Consider making your collection strongly typed. Strongly typed collections provide automatic type validation and avoid processes that adversely affect performance, such as boxing and unboxing and conversions. If your language supports generics, use one of the System.Collections.Generic types. If your language does not support generics, System.Collections.Specialized contains examples of strongly typed collections.

  • Consider providing synchronization in your class. See Collections and Synchronization (Thread Safety) for details.

Selecting a Collection Class

Provides guidance for selecting the most appropriate collection type.

Enumerating a Collection

Discusses enumerators and their use with collections.

Collections and Synchronization (Thread Safety)

Discusses the use of collections in multithreaded applications.

Comparisons and Sorts Within Collections

Discusses the use of equality comparisons and sorting comparisons in collections.

System.Collections

Provides reference documentation for the System.Collections namespace, which contains interfaces and classes that define various collections of objects.

System.Collections.Specialized

Provides reference documentation for the System.Collections.Specialized namespace, which contains specialized and strongly-typed collections.

System.Collections.Generic

Provides reference documentation for the System.Collections.Generic namespace, which contains interfaces and classes that define generic collections.

Collections and Data Structures

Discusses the various collection types available in the .NET Framework, including stacks, queues, lists, arrays, and structs.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.