Note
Whenever possible, try to use the generic TryInsertRange<T> overload for better performance.
public static bool TryInsertRange(
this IEnumerable target,
int index,
IEnumerable collection,
bool checkReadOnlyAndBounds = true,
bool throwError = true
)
<ExtensionAttribute>
Public Shared Function TryInsertRange (
target As IEnumerable,
index As Integer,
collection As IEnumerable,
Optional checkReadOnlyAndBounds As Boolean = true,
Optional throwError As Boolean = true
) As Boolean
public:
[ExtensionAttribute]
static bool TryInsertRange(
IEnumerable^ target,
int index,
IEnumerable^ collection,
bool checkReadOnlyAndBounds = true,
bool throwError = true
)
[<ExtensionAttribute>]
static member TryInsertRange :
target : IEnumerable *
index : int *
collection : IEnumerable *
?checkReadOnlyAndBounds : bool *
?throwError : bool
(* Defaults:
let _checkReadOnlyAndBounds = defaultArg checkReadOnlyAndBounds true
let _throwError = defaultArg throwError true
*)
-> bool
The specified collection can be inserted in the target collection if that is either an IListT or IList implementation.
If target is neither a ListT nor an ISupportsRangeCollectionT implementation, then the elements of collection will only be inserted one by one.