CollectionExt.ThrowIfInvalidIndexes<T> Method (IReadOnlyCollection<T>, Int32, Int32)

Throws an exception if any of the given indexes is out of a IReadOnlyCollection<T> bounds.

Namespace: UltimateXR.Extensions.System.Collections
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static void ThrowIfInvalidIndexes<T>(
	this IReadOnlyCollection<T> self,
	int index1,
	int index2
)

Parameters

 

self
Type: System.Collections.Generic.IReadOnlyCollection<T>
Collection
index1
Type: System.Int32
Index 1 to check if it is out of bounds
index2
Type: System.Int32
Index 2 to check if it is out of bounds

Type Parameters

 

T
Element type

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyCollection<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

CollectionExt Class
ThrowIfInvalidIndexes Overload
UltimateXR.Extensions.System.Collections Namespace
CollectionExt.ThrowIfInvalidIndex<T>(IReadOnlyCollection<T>, Int32, String)