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
public IndexPair(int i, int j)
Initializes a new instance of IndexPair with two indices.
i (int)A first index.
j (int)A second index.

Properties

Count

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

I

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

J

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

ICollection<int>.IsReadOnly

#
bool ICollection<int>.IsReadOnly

Indexers

this[]

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

Methods

Contains

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

CopyTo

#Since v6.0
public void CopyTo(int[] array, int arrayIndex)
Copies the elements of the IndexPair to an Array, starting at a particular Array index.
array (int[])The one-dimensional Array that is the destination of the elements copied from IndexPair. The Array must have zero-based indexing.
arrayIndex (int)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
public IEnumerator<int> GetEnumerator()
Gets an enumerator that goes over I and J, in this order.
The needed enumerator.

IndexOf

#Since v6.0
public int IndexOf(int item)
Determines the index of a specific item in IndexPair.
item (int)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(int item)
item (int)
Explicit

ICollection<int>.Clear

#
void ICollection<int>.Clear()
Explicit

ICollection<int>.Remove

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

IList<int>.Insert

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

IList<int>.RemoveAt

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

IEnumerable.GetEnumerator

#Since v6.0
IEnumerator IEnumerable.GetEnumerator()