# IndexPair struct

Namespace: [Rhino](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
[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](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/ctor.md): Initializes a new instance of [IndexPair](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair.md) with two indices.

## Properties

- [Count](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/count.md): Returns the amount of elements in this pair of indices, which is always 2.
- [I](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/i.md): Gets or sets the first, I index.
- [J](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/j.md): Gets or sets the second, J index.
- [ICollection<int>.IsReadOnly](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-icollection-system-int32-isreadonly.md)

## Indexers

- [this[]](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/item.md): Gets or sets a particular index of this structure. Only 0 and 1 are valid indices.

## Methods

- [Contains](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/contains.md): Determines whether the [IndexPair](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair.md) contains a specific value.
- [CopyTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/copyto.md): Copies the elements of the [IndexPair](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair.md) to an `Array`, starting at a particular `Array` index.
- [GetEnumerator](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/getenumerator.md): Gets an enumerator that goes over [IndexPair.I](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/i.md) and [IndexPair.J](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/j.md), in this order.
- [IndexOf](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/indexof.md): Determines the index of a specific item in [IndexPair](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair.md).
- [ICollection<int>.Add](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-icollection-system-int32-add.md)
- [ICollection<int>.Clear](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-icollection-system-int32-clear.md)
- [ICollection<int>.Remove](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-icollection-system-int32-remove.md)
- [IList<int>.Insert](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-ilist-system-int32-insert.md)
- [IList<int>.RemoveAt](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-generic-ilist-system-int32-removeat.md)
- [IEnumerable.GetEnumerator](https://developer.rhino3d.com/api/rhinocommon/type/rhino.indexpair/system-collections-ienumerable-getenumerator.md)
