User Tools

Site Tools


collections

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
collections [2018/02/04 18:23] – created wolfgangriedmanncollections [2018/02/04 18:42] wolfgangriedmann
Line 1: Line 1:
 ====== Collections ====== ====== Collections ======
 +
 +The collections in many aspects are similar to the VO arrays, but they differ from them as you need to specify the type of the elements (of course, you can type the elements as ''object'' leaving this completely open.
 +
 +The collections are available in the namespaces
 +  * System.Collections
 +  * System.Collections.Generic
 +  * System.Collections.Concurrent
 +  * System.Collections.ObjectModel
 +  * System.Collections.Specialized
 +There are a lot of different ''Collection'' classes, but the most important are:
 +  * [[https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1|System.Collections.Generic.List<T>]]
 +  * [[https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2|System.Collections.Generic.Dictionary<TKey,TValue>]]
 +  * [[https://docs.microsoft.com/en-us/dotnet/api/system.collections.sortedlist|System.Collections.SortedList]]
 +  * [[https://docs.microsoft.com/en-us/dotnet/api/system.collections.arraylist|System.Collections.ArrayList]]
 +
 +If you need some help, which Collection class to use, here is a help:
 +
 +  * [[https://docs.microsoft.com/en-us/dotnet/standard/collections/selecting-a-collection-class|MSDN: Selecting a collection class]]
 +  * [[https://docs.microsoft.com/en-us/dotnet/standard/collections/commonly-used-collection-types|MSDN: Commonly used collection types]]
 +
 +But it is very important to know that you **cannot** change a collection while you are using it in a ''foreach'' loop.
 +
 +
 +
  
collections.txt · Last modified: 2018/02/05 05:20 by wolfgangriedmann