Class Change<T>
- Namespace
- DynamicData
- Assembly
- DynamicData.dll
Container to describe a single change to a cache.
public sealed class Change<T> : IEquatable<Change<T>> where T : notnull
Type Parameters
T
The type of the item.
- Inheritance
-
Change<T>
- Implements
-
IEquatable<Change<T>>
Constructors
Change(ListChangeReason, IEnumerable<T>, int)
Initializes a new instance of the Change<T> class.
public Change(ListChangeReason reason, IEnumerable<T> items, int index = -1)
Parameters
reason
ListChangeReasonThe reason.
items
IEnumerable<T>The items.
index
intThe index.
Change(ListChangeReason, T, in Optional<T>, int, int)
Initializes a new instance of the Change<T> class. Initializes a new instance of the Change<TObject, TKey> struct.
public Change(ListChangeReason reason, T current, in Optional<T> previous, int currentIndex = -1, int previousIndex = -1)
Parameters
reason
ListChangeReasonThe reason.
current
TThe current.
previous
Optional<T>The previous.
currentIndex
intValue of the current.
previousIndex
intValue of the previous.
Exceptions
- ArgumentException
For ChangeReason.Add, a previous value cannot be specified or For ChangeReason.Change, must supply previous value.
Change(ListChangeReason, T, int)
Initializes a new instance of the Change<T> class.
public Change(ListChangeReason reason, T current, int index = -1)
Parameters
reason
ListChangeReasonThe reason.
current
TThe current.
index
intThe index.
Change(T, int, int)
Initializes a new instance of the Change<T> class. Constructor for ChangeReason.Move.
public Change(T current, int currentIndex, int previousIndex)
Parameters
current
TThe current.
currentIndex
intThe CurrentIndex.
previousIndex
intCurrentIndex of the previous.
Exceptions
- ArgumentException
CurrentIndex must be greater than or equal to zero or PreviousIndex must be greater than or equal to zero.
Properties
Item
Gets a single item change.
public ItemChange<T> Item { get; }
Property Value
- ItemChange<T>
Range
Gets a multiple item change.
public RangeChange<T> Range { get; }
Property Value
- RangeChange<T>
Reason
Gets the reason for the change.
public ListChangeReason Reason { get; }
Property Value
Type
Gets a value indicating whether the change is a single item change or a range change.
public ChangeType Type { get; }
Property Value
- ChangeType
The type.
Methods
Equals(Change<T>?)
public bool Equals(Change<T>? other)
Parameters
other
Change<T>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(Change<T>, Change<T>)
public static bool operator ==(Change<T> left, Change<T> right)
Parameters
Returns
operator !=(Change<T>, Change<T>)
public static bool operator !=(Change<T> left, Change<T> right)