FreezableCollection<T> Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of FreezableCollection<T>.
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. |
Initializes a new instance of FreezableCollection<T> that is empty and has the default initial capacity.
public:
FreezableCollection();
public FreezableCollection ();
Public Sub New ()
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 |
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);
public FreezableCollection (System.Collections.Generic.IEnumerable<T> collection);
new System.Windows.FreezableCollection<'T (requires 'T :> System.Windows.DependencyObject)> : seq<'T (requires 'T :> System.Windows.DependencyObject)> -> System.Windows.FreezableCollection<'T (requires 'T :> System.Windows.DependencyObject)>
Public Sub New (collection As IEnumerable(Of T))
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 |
Initializes a new instance of the FreezableCollection<T> that is empty and has the specified initial capacity.
public:
FreezableCollection(int capacity);
public FreezableCollection (int capacity);
new System.Windows.FreezableCollection<'T (requires 'T :> System.Windows.DependencyObject)> : int -> System.Windows.FreezableCollection<'T (requires 'T :> System.Windows.DependencyObject)>
Public Sub New (capacity As Integer)
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 |
.NET feedback
.NET er et åben kildekode projekt. Vælg et link for at give feedback: