Struct Change<TObject, TKey>
- Namespace
- Dynamic
Data
- Assembly
- DynamicData.dll
Container to describe a single change to a cache.
public readonly struct Change<TObject, TKey> : IEquatable<Change<TObject, TKey>> where TObject : notnull where TKey : notnull
Type Parameters
TObjectThe type of the object.
TKeyThe type of the key.
- Implements
-
IEquatable<Change<TObject, TKey>>
- Extension Methods
Constructors
Change(ChangeReason, TKey, TObject, in Optional<TObject>, int, int)
Initializes a new instance of the Change<TObject, TKey> struct.
public Change(ChangeReason reason, TKey key, TObject current, in Optional<TObject> previous, int currentIndex = -1, int previousIndex = -1)
Parameters
reasonChangeReason The reason.
keyTKeyThe key.
currentTObjectThe current.
previousOptional<TObject>The previous.
currentIndexintValue of the current.
previousIndexintValue of the previous.
Exceptions
- Argument
Exception For ChangeReason.Add, a previous value cannot be specified or For ChangeReason.Change, must supply previous value.
Change(ChangeReason, TKey, TObject, int)
Initializes a new instance of the Change<TObject, TKey> struct.
Parameters
reasonChangeReason The reason.
keyTKeyThe key.
currentTObjectThe current.
indexintThe index.
Change(TKey, TObject, int, int)
Initializes a new instance of the Change<TObject, TKey> struct. Constructor for ChangeReason.Move.
Parameters
keyTKeyThe key.
currentTObjectThe current.
currentIndexintThe CurrentIndex.
previousIndexintCurrentIndex of the previous.
Exceptions
- Argument
Exception CurrentIndex must be greater than or equal to zero or PreviousIndex must be greater than or equal to zero.
Properties
Current
Gets the item which has changed.
Property Value
- TObject
CurrentIndex
Gets the current index.
Property Value
Key
Gets the unique key of the item which has changed.
Property Value
- TKey
Previous
Gets the previous change.
This is only when Reason==ChangeReason.Replace.
Property Value
- Optional<TObject>
PreviousIndex
Gets the previous change.
This is only when Reason==ChangeReason.Update or ChangeReason.Move.
Property Value
Reason
Gets the reason for the change.
Property Value
Methods
Equals(Change<TObject, TKey>)
Parameters
otherChange<TObject, TKey>
Returns
Equals(object?)
Parameters
objobject
Returns
GetHashCode()
Returns
ToString()
Returns
Operators
operator ==(in Change<TObject, TKey>, in Change<TObject, TKey>)
Determines whether the specified objects are equal.
Parameters
leftChange<TObject, TKey>The left value to compare.
rightChange<TObject, TKey>The right value to compare.
Returns
- bool
If the two values are equal to each other.
operator !=(in Change<TObject, TKey>, in Change<TObject, TKey>)
Determines whether the specified objects are equal.
Parameters
leftChange<TObject, TKey>The left value to compare.
rightChange<TObject, TKey>The right value to compare.
Returns
- bool
If the two values are not equal to each other.