Connectivity Software User's Guide and Reference
Collection2<T> Constructor(IList<T>)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Collections.ObjectModel Namespace > Collection2<T> Class > Collection2<T> Constructor : Collection2<T> Constructor(IList<T>)
The list that is wrapped by the new collection.

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value can be null (Nothing in Visual Basic).

Initializes a new instance of the collection class as a wrapper for the specified list.
Syntax
'Declaration
 
<ObsoleteAttribute("Not obsolete, but be aware that this constructor wraps the specified list, making it subject to subsequent changes through the collection.")>
Public Function New( _
   ByVal list As IList(Of T) _
)
'Usage
 
Dim list As IList(Of T)
 
Dim instance As New Collection2(Of T)(list)
[Obsolete("Not obsolete, but be aware that this constructor wraps the specified list, making it subject to subsequent changes through the collection.")]
public Collection2<T>( 
   IList<T> list
)
[Obsolete("Not obsolete, but be aware that this constructor wraps the specified list, making it subject to subsequent changes through the collection.")]
public:
Collection2<T>( 
   IList<T^>^ list
)

Parameters

list
The list that is wrapped by the new collection.

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value can be null (Nothing in Visual Basic).

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also