Guard.IsInRangeFor Method
Definition
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.
Overloads
| IsInRangeFor(Int32, String, String) |
Asserts that the input index is valid for a given String instance. |
| IsInRangeFor<T>(Int32, T[], String) |
Asserts that the input index is valid for a given <see typeparamref="T"></see> array instance. |
| IsInRangeFor<T>(Int32, Span<T>, String) |
Asserts that the input index is valid for a given Span<T> instance. |
| IsInRangeFor<T>(Int32, ReadOnlySpan<T>, String) |
Asserts that the input index is valid for a given ReadOnlySpan<T> instance. |
| IsInRangeFor<T>(Int32, ReadOnlyMemory<T>, String) |
Asserts that the input index is valid for a given ReadOnlyMemory<T> instance. |
| IsInRangeFor<T>(Int32, List<T>, String) |
Asserts that the input index is valid for a given List<T> instance. |
| IsInRangeFor<T>(Int32, IReadOnlyCollection<T>, String) |
Asserts that the input index is valid for a given IReadOnlyCollection<T> instance. |
| IsInRangeFor<T>(Int32, ICollection<T>, String) |
Asserts that the input index is valid for a given ICollection<T> instance. |
| IsInRangeFor<T>(Int32, Memory<T>, String) |
Asserts that the input index is valid for a given Memory<T> instance. |
IsInRangeFor(Int32, String, String)
- Source:
- Guard.String.cs
- Source:
- Guard.String.cs
Asserts that the input index is valid for a given String instance.
public static void IsInRangeFor(int index, string text, string name = "");
public static void IsInRangeFor(int index, string text, string name);
static member IsInRangeFor : int * string * string -> unit
Public Shared Sub IsInRangeFor (index As Integer, text As String, Optional name As String = "")
Public Shared Sub IsInRangeFor (index As Integer, text As String, name As String)
Parameters
- index
- Int32
The input index to be used to access text.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access text.
Applies to
IsInRangeFor<T>(Int32, T[], String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given <see typeparamref="T"></see> array instance.
public static void IsInRangeFor<T>(int index, T[] array, string name = "");
public static void IsInRangeFor<T>(int index, T[] array, string name);
static member IsInRangeFor : int * 'T[] * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, array As T(), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, array As T(), name As String)
Type Parameters
- T
The item of items in the input <see typeparamref="T"></see> array instance.
Parameters
- index
- Int32
The input index to be used to access array.
- array
- T[]
The input <see typeparamref="T"></see> array instance to use to validate index.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access array.
Applies to
IsInRangeFor<T>(Int32, Span<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given Span<T> instance.
public static void IsInRangeFor<T>(int index, Span<T> span, string name = "");
public static void IsInRangeFor<T>(int index, Span<T> span, string name);
static member IsInRangeFor : int * Span<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, span As Span(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, span As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- index
- Int32
The input index to be used to access span.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access span.
Applies to
IsInRangeFor<T>(Int32, ReadOnlySpan<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given ReadOnlySpan<T> instance.
public static void IsInRangeFor<T>(int index, ReadOnlySpan<T> span, string name = "");
public static void IsInRangeFor<T>(int index, ReadOnlySpan<T> span, string name);
static member IsInRangeFor : int * ReadOnlySpan<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, span As ReadOnlySpan(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, span As ReadOnlySpan(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- index
- Int32
The input index to be used to access span.
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<T> instance to use to validate index.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access span.
Applies to
IsInRangeFor<T>(Int32, ReadOnlyMemory<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given ReadOnlyMemory<T> instance.
public static void IsInRangeFor<T>(int index, ReadOnlyMemory<T> memory, string name = "");
public static void IsInRangeFor<T>(int index, ReadOnlyMemory<T> memory, string name);
static member IsInRangeFor : int * ReadOnlyMemory<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, memory As ReadOnlyMemory(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, memory As ReadOnlyMemory(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- index
- Int32
The input index to be used to access memory.
- memory
- ReadOnlyMemory<T>
The input ReadOnlyMemory<T> instance to use to validate index.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access memory.
Applies to
IsInRangeFor<T>(Int32, List<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given List<T> instance.
public static void IsInRangeFor<T>(int index, System.Collections.Generic.List<T> list, string name = "");
public static void IsInRangeFor<T>(int index, System.Collections.Generic.List<T> list, string name);
static member IsInRangeFor : int * System.Collections.Generic.List<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, list As List(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, list As List(Of T), name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- index
- Int32
The input index to be used to access list.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access list.
Applies to
IsInRangeFor<T>(Int32, IReadOnlyCollection<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given IReadOnlyCollection<T> instance.
public static void IsInRangeFor<T>(int index, System.Collections.Generic.IReadOnlyCollection<T> collection, string name = "");
public static void IsInRangeFor<T>(int index, System.Collections.Generic.IReadOnlyCollection<T> collection, string name);
static member IsInRangeFor : int * System.Collections.Generic.IReadOnlyCollection<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, collection As IReadOnlyCollection(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, collection As IReadOnlyCollection(Of T), name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- index
- Int32
The input index to be used to access collection.
- collection
- IReadOnlyCollection<T>
The input IReadOnlyCollection<T> instance to use to validate index.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access collection.
Applies to
IsInRangeFor<T>(Int32, ICollection<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given ICollection<T> instance.
public static void IsInRangeFor<T>(int index, System.Collections.Generic.ICollection<T> collection, string name = "");
public static void IsInRangeFor<T>(int index, System.Collections.Generic.ICollection<T> collection, string name);
static member IsInRangeFor : int * System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, collection As ICollection(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, collection As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- index
- Int32
The input index to be used to access collection.
- collection
- ICollection<T>
The input ICollection<T> instance to use to validate index.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access collection.
Applies to
IsInRangeFor<T>(Int32, Memory<T>, String)
- Source:
- Guard.Collection.g.cs
- Source:
- Guard.Collection.g.cs
Asserts that the input index is valid for a given Memory<T> instance.
public static void IsInRangeFor<T>(int index, Memory<T> memory, string name = "");
public static void IsInRangeFor<T>(int index, Memory<T> memory, string name);
static member IsInRangeFor : int * Memory<'T> * string -> unit
Public Shared Sub IsInRangeFor(Of T) (index As Integer, memory As Memory(Of T), Optional name As String = "")
Public Shared Sub IsInRangeFor(Of T) (index As Integer, memory As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- index
- Int32
The input index to be used to access memory.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if index is not valid to access memory.