Table of Contents

Struct ElementIndex<T>

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an element from an observable sequence associated with its index information. The zero-based index represents the order of the element in the sequence.

public struct ElementIndex<T> : IEquatable<ElementIndex<T>>

Type Parameters

T

The type of the value being annotated with index information.

Implements
Inherited Members

Constructors

ElementIndex(T, int)

Initializes a new instance of the ElementIndex<T> class with the specified value and index information.

public ElementIndex(T value, int index)

Parameters

value T

The value to be annotated with index information.

index int

The zero-based index of the element in the sequence.

Properties

Index

Gets the zero-based index of the element in the sequence.

public int Index { get; }

Property Value

int

Value

Gets the value of the element.

public T Value { get; }

Property Value

T

Methods

Equals(ElementIndex<T>)

Returns a value indicating whether this instance has the same value and index as a specified ElementIndex<T> structure.

public bool Equals(ElementIndex<T> other)

Parameters

other ElementIndex<T>

The ElementIndex<T> structure to compare to this instance.

Returns

bool

true if other has the same value and index as this instance; otherwise, false.

Equals(object)

Tests to see whether the specified object is an ElementIndex<T> structure with the same value and index as this ElementIndex<T> structure.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with this instance.

Returns

bool

true if obj is an ElementIndex<T> and has the same value and index as this ElementIndex<T>; otherwise, false.

GetHashCode()

Returns a hash code for the current instance.

public override int GetHashCode()

Returns

int

The hash code for the current instance.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(ElementIndex<T>, ElementIndex<T>)

Tests whether two ElementIndex<T> structures are equal.

public static bool operator ==(ElementIndex<T> left, ElementIndex<T> right)

Parameters

left ElementIndex<T>

The ElementIndex<T> structure on the left-hand side of the equality operator.

right ElementIndex<T>

The ElementIndex<T> structure on the right-hand side of the equality operator.

Returns

bool

true if left and right have equal value and index; otherwise, false.

operator !=(ElementIndex<T>, ElementIndex<T>)

Tests whether two ElementIndex<T> structures are different.

public static bool operator !=(ElementIndex<T> left, ElementIndex<T> right)

Parameters

left ElementIndex<T>

The ElementIndex<T> structure on the left-hand side of the inequality operator.

right ElementIndex<T>

The ElementIndex<T> structure on the right-hand side of the inequality operator.

Returns

bool

true if left and right differ either in value or index; false if left and right are equal.