OfficeDiffResult<T>
OfficeIMO.Diff
Edit script between two sequences produced by OfficeDiff.
Inheritance
- object
- OfficeDiffResult<T>
Usage
Explore 7 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 5
- Method OfficeDiff.CompareCharacters
- Method OfficeDiff.CompareLines
- Method OfficeDiff.CompareTokens
- Method OfficeDiff.CompareWords
- Method OfficeDiff.Compare``1
Accepted by parameters 2
- Method OfficeChangeSet.FromTextDiff
- Method OfficeUnifiedDiff.Format
Type Parameters
- T
- Item type.
Methods
public IReadOnlyList<T?> Apply(IReadOnlyList<T?> source) #Applies the edit script to source and returns the new sequence. Every kept and deleted item is checked against the item recorded in the script; kept positions return the recorded new item, so a comparer that ignores case or position still yields the new values.
Parameters
- source System.Collections.Generic.IReadOnlyList<T?>
Returns
IReadOnlyList<T?>Exceptions
InvalidOperationException– The source does not match the old sequence this script was computed from.
public IReadOnlyList<OfficeDiffHunk> GetChangedRegions() #Groups the edit script into changed regions: each region is a maximal run of deletions and insertions between unchanged items.
Returns
IReadOnlyList<OfficeDiffHunk>public IReadOnlyList<T?> Revert(IReadOnlyList<T?> target) #Reverts the edit script on target and returns the old sequence.
Parameters
- target System.Collections.Generic.IReadOnlyList<T?>
Returns
IReadOnlyList<T?>Exceptions
InvalidOperationException– The target does not match the new sequence this script was computed from.
Inherited Methods
Properties
public IReadOnlyList<OfficeDiffEdit> Edits { get; } #Edit runs in order. Together they cover every old item and every new item exactly once; within each changed region the deletion comes before the insertion.
public OfficeDiffAlgorithm Algorithm { get; } #Algorithm that produced the alignment.
public bool LimitReached { get; } #True when a work, time or depth limit stopped the alignment early. The edit script is still complete and correct (applying it to OfficeDiffResult<T>.Old yields OfficeDiffResult<T>.New), but some unchanged items may be reported as deleted and reinserted.
public bool AreEqual { get; } #True when the sequences are equal under OfficeDiffResult<T>.Comparer.