Table of Contents

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 T

The item.

index int

The 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

int

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

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

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

string

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 and right 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 and right are not equal; otherwise, false.