FreezableCollection<T> Constructors

Definition

Initializes a new instance of FreezableCollection<T>.

Overloads

FreezableCollection<T>()

Initializes a new instance of FreezableCollection<T> that is empty and has the default initial capacity.

FreezableCollection<T>(IEnumerable<T>)

Initializes a new instance of the FreezableCollection<T> class that contains the same elements as the specified collection.

FreezableCollection<T>(Int32)

Initializes a new instance of the FreezableCollection<T> that is empty and has the specified initial capacity.

FreezableCollection<T>()

Initializes a new instance of FreezableCollection<T> that is empty and has the default initial capacity.

public FreezableCollection ();

Applies to

.NET Framework 4.8.1 og andre versioner
Produkt Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FreezableCollection<T>(IEnumerable<T>)

Initializes a new instance of the FreezableCollection<T> class that contains the same elements as the specified collection.

public FreezableCollection (System.Collections.Generic.IEnumerable<T> collection);

Parameters

collection
IEnumerable<T>

The collection whose items should be added to the new FreezableCollection<T>.

Exceptions

collection is null.

Remarks

This operation performs a shallow copy on the specified collection; only references to the collection's elements are copied, the elements themselves are not cloned. Modifying an element of the new FreezableCollection<T> also modifies that element for collection.

The elements are placed in the new FreezableCollection<T> in the same order they are read by the enumerator of the specified collection.

Applies to

.NET Framework 4.8.1 og andre versioner
Produkt Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

FreezableCollection<T>(Int32)

Initializes a new instance of the FreezableCollection<T> that is empty and has the specified initial capacity.

public FreezableCollection (int capacity);

Parameters

capacity
Int32

A value that is greater than or equal to 0 that specifies the number of elements the new collection can initially store.

Exceptions

capacity is less than 0.

Applies to

.NET Framework 4.8.1 og andre versioner
Produkt Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9