Struct ItemWithIndex<T>
- Namespace
- DynamicData.Kernel
- Assembly
- DynamicData.dll
Container for an item and it's index from a list.
public readonly struct ItemWithIndex<T> : IEquatable<ItemWithIndex<T>>
Type Parameters
T
The type of the item.
- Implements
Remarks
Initializes a new instance of the ItemWithIndex<T> struct. Initializes a new instance of the ItemWithIndex<T> class.
Constructors
ItemWithIndex(T, int)
Container for an item and it's index from a list.
public ItemWithIndex(T item, int index)
Parameters
item
TThe item.
index
intThe index.
Remarks
Initializes a new instance of the ItemWithIndex<T> struct. Initializes a new instance of the ItemWithIndex<T> class.
Properties
Index
Gets the index.
public int Index { get; }
Property Value
Item
Gets the item.
public T Item { get; }
Property Value
- T
Methods
Equals(ItemWithIndex<T>)
public bool Equals(ItemWithIndex<T> other)
Parameters
other
ItemWithIndex<T>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
public override string ToString()
Returns
Operators
operator ==(in ItemWithIndex<T>, in ItemWithIndex<T>)
Returns a value that indicates whether the values of two ItemWithIndex<T> objects are equal.
public static bool operator ==(in ItemWithIndex<T> left, in ItemWithIndex<T> right)
Parameters
left
ItemWithIndex<T>The first value to compare.
right
ItemWithIndex<T>The second value to compare.
Returns
- bool
true if the
left
andright
parameters have the same value; otherwise, false.
operator !=(in ItemWithIndex<T>, in ItemWithIndex<T>)
Returns a value that indicates whether two ItemWithIndex<T> objects have different values.
public static bool operator !=(in ItemWithIndex<T> left, in ItemWithIndex<T> right)
Parameters
left
ItemWithIndex<T>The first value to compare.
right
ItemWithIndex<T>The second value to compare.
Returns
- bool
true if
left
andright
are not equal; otherwise, false.