Show / Hide Table of Contents

Struct ValueChange<T>

Records a value change in a diff as recorded by a DiffAwareGridView<T>.

Implements
IEquatable<ValueChange<T>>
IMatchable<ValueChange<T>>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
[DataContract]
public readonly struct ValueChange<T> : IEquatable<ValueChange<T>>, IMatchable<ValueChange<T>> where T : struct
Type Parameters
Name Description
T

Type of value being changed.

Constructors

View Source

ValueChange(Point, T, T)

Creates a new value change record.

Declaration
public ValueChange(Point position, T oldValue, T newValue)
Parameters
Type Name Description
Point position

Position whose value was changed.

T oldValue

Original value that was changed.

T newValue

New value that was set.

Fields

View Source

NewValue

New value that was set.

Declaration
[DataMember]
public readonly T NewValue
Field Value
Type Description
T
View Source

OldValue

Original value that was changed.

Declaration
[DataMember]
public readonly T OldValue
Field Value
Type Description
T
View Source

Position

Position whose value was changed.

Declaration
[DataMember]
public readonly Point Position
Field Value
Type Description
Point

Methods

View Source

Equals(ValueChange<T>)

Compares the two changes according to their positions and values.

Declaration
public bool Equals(ValueChange<T> other)
Parameters
Type Name Description
ValueChange<T> other
Returns
Type Description
bool

True if the two value changes represent the same change, false otherwise.

View Source

Equals(object?)

Compares the two changes according to their types, positions and values.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool

True if the two value changes represent the same object and change, false otherwise.

Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Returns a hash value computed using the item's position, old value, and new value.

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Matches(ValueChange<T>)

Compares the two changes according to their positions and values.

Declaration
public bool Matches(ValueChange<T> other)
Parameters
Type Name Description
ValueChange<T> other
Returns
Type Description
bool

True if the two value changes represent the same change, false otherwise.

View Source

ToString()

Returns a string representing the object, including its position, old value, and new value.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()

Operators

View Source

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

Tests the two changes by their fields for equality.

Declaration
public static bool operator ==(ValueChange<T> left, ValueChange<T> right)
Parameters
Type Name Description
ValueChange<T> left
ValueChange<T> right
Returns
Type Description
bool

True if all the changes are equivalent; false otherwise.

View Source

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

Tests the two changes by their fields for inequality.

Declaration
public static bool operator !=(ValueChange<T> left, ValueChange<T> right)
Parameters
Type Name Description
ValueChange<T> left
ValueChange<T> right
Returns
Type Description
bool

True if all the changes are equivalent; false otherwise.

Implements

IEquatable<T>
IMatchable<T>

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?, EventHandler<ValueChangedEventArgs<TProperty>>?)
  • View Source
In this article
Back to top Generated by DocFX