IndexPair

References
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 8)] [DebuggerDisplay("{m_i}, {m_j}")] [Serializable] public struct IndexPair : IList<int>, IReadOnlyList<int>
Represents two indices: I and J.

Constructors

IndexPair

#Since v5.0
Initializes a new instance of IndexPair with two indices.
public IndexPair(
i,
A first index.
j
A second index.
)

Properties

Count

#Since v6.0
Returns the amount of elements in this pair of indices, which is always 2.
public int Count { get; }

I

#Since v5.0
Gets or sets the first, I index.
public int I { get; set; }

J

#Since v5.0
Gets or sets the second, J index.
public int J { get; set; }
Explicit

ICollection<int>.IsReadOnly

#
bool ICollection<int>.IsReadOnly

Indexers

this[]

#
Gets or sets a particular index of this structure. Only 0 and 1 are valid indices.
public int this[
index
Either 0 for I, or 1 for J.
] { get; set; }
The value at the index.

Methods

Contains

#Since v6.0
Determines whether the IndexPair contains a specific value.
public bool Contains(
item
The number to locate in the IndexPair.
)
true if item is found in the IndexPair; otherwise, false.

CopyTo

#Since v6.0
Copies the elements of the IndexPair to an Array, starting at a particular Array index.
public void CopyTo(
int[]
array,
The one-dimensional Array that is the destination of the elements copied from IndexPair. The Array must have zero-based indexing.
arrayIndex
The zero-based index in array at which copying begins.
)
ArgumentNullExceptionarray is null.
ArgumentOutOfRangeExceptionarrayIndex is less than 0 or arrayIndex is greater than or equals the length of array minus 2.
ArgumentExceptionThe length of the array is less than 2.

GetEnumerator

#Since v6.0
Gets an enumerator that goes over I and J, in this order.
public IEnumerator<int> GetEnumerator()
The needed enumerator.

IndexOf

#Since v6.0
Determines the index of a specific item in IndexPair.
public int IndexOf(
item
The object to locate in the IList.
)
The index, 0 for I or 1 for J of item if found in the list; otherwise, -1.
Explicit

ICollection<int>.Add

#
void ICollection<int>.Add(
item
)
Explicit

ICollection<int>.Clear

#
void ICollection<int>.Clear()
Explicit

ICollection<int>.Remove

#
bool ICollection<int>.Remove(
item
)
Explicit

IList<int>.Insert

#
void IList<int>.Insert(
index,
item
)
Explicit

IList<int>.RemoveAt

#
void IList<int>.RemoveAt(
index
)
Explicit

IEnumerable.GetEnumerator

#Since v6.0
IEnumerator IEnumerable.GetEnumerator()