CollectionExtensions.AddRange<T> Method
Adds the elements of the specified collection to the existing collection.
Namespace: Microsoft.Rtc.Signaling
Assembly: Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub AddRange(Of T) ( _
collectionToUpdate As Collection(Of T), _
collection As IEnumerable(Of T) _
)
'Usage
Dim collectionToUpdate As Collection(Of T)
Dim collection As IEnumerable(Of T)
collectionToUpdate.AddRange(collection)
public static void AddRange<T>(
this Collection<T> collectionToUpdate,
IEnumerable<T> collection
)
Type Parameters
- T
Type of item in the collection
Parameters
- collectionToUpdate
Type: System.Collections.ObjectModel.Collection<T>
The existing collection.
- collection
Type: System.Collections.Generic.IEnumerable<T>
The collection of items to add.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Collection<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=office.14) or https://msdn.microsoft.com/en-us/library/bb383977(v=office.14).
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when the collection parameter is null. |