Show / Hide Table of Contents

Class Diff<T>

Represents a unique patch/diff of the state of a DiffAwareGridView<T>.

Inheritance
object
Diff<T>
Implements
IEnumerable<ValueChange<T>>
IEnumerable
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
public class Diff<T> : IEnumerable<ValueChange<T>>, IEnumerable where T : struct
Type Parameters
Name Description
T

Type of value stored in the grid view.

Constructors

View Source

Diff()

Creates a new empty diff.

Declaration
public Diff()
View Source

Diff(IEnumerable<ValueChange<T>>)

Creates a diff composed of the specified changes.

Declaration
public Diff(IEnumerable<ValueChange<T>> changes)
Parameters
Type Name Description
IEnumerable<ValueChange<T>> changes

Changes to create a diff from.

Properties

View Source

Changes

Read-only list of changes made in this time step.

Declaration
public IReadOnlyList<ValueChange<T>> Changes { get; }
Property Value
Type Description
IReadOnlyList<ValueChange<T>>
View Source

IsCompressed

Whether or not the diff is currently known to be at the minimal possible size.

Declaration
public bool IsCompressed { get; }
Property Value
Type Description
bool
View Source

IsFinalized

Whether or not the list of changes in this diff has been finalized, eg allows more changes to be added.

Declaration
public bool IsFinalized { get; }
Property Value
Type Description
bool

Methods

View Source

Add(ValueChange<T>)

Adds a change to the diff.

Declaration
public void Add(ValueChange<T> change)
Parameters
Type Name Description
ValueChange<T> change

Change to add.

View Source

Compress()

Reduces the diff to the minimum possible changes to achieve the resulting values by removing duplicate positions from the change list.

Declaration
public void Compress()
View Source

FinalizeChanges()

Finalizes the current diff, such that no changes are allowed to be added to it. It can still be compressed.

Declaration
public void FinalizeChanges()
View Source

GetEnumerator()

Returns an enumerator of the changes in the diff.

Declaration
public IEnumerator<ValueChange<T>> GetEnumerator()
Returns
Type Description
IEnumerator<ValueChange<T>>

Implements

IEnumerable<T>
IEnumerable

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>>?)
ToStringExtensions.ExtendToString<T>(IEnumerable<T>, string, Func<T, string>?, string, string)
  • View Source
In this article
Back to top Generated by DocFX