OfficeChangeSet
OfficeIMO.Diff
The changes between two documents in a format-neutral form, ready to serialise to JSON or render as a report.
Inheritance
- object
- OfficeChangeSet
Usage
Explore 2 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 2
- Method OfficeChangeSet.FromTextDiff
- Property OfficeDiffHtmlOptions.Changes
Constructors
public OfficeChangeSet(IEnumerable<OfficeChange> changes, string? oldSource = null, string? newSource = null, string unit = "word", bool isComplete = true) #Creates a change set.
Parameters
- changes System.Collections.Generic.IEnumerable<OfficeIMO.Diff.OfficeChange>
- Changes in document order.
- oldSource string? = null
- Name of the old document.
- newSource string? = null
- Name of the new document.
- unit string = "word"
- Token unit the changes were computed in, for example word or line.
- isComplete bool = true
- False when a work or time limit stopped the comparison early (see OfficeChangeSet.IsComplete).
Methods
public int Count(OfficeChangeKind kind) #Number of changes of the given kind.
Parameters
- kind OfficeIMO.Diff.OfficeChangeKind
Returns
intpublic static OfficeChangeSet FromTextDiff(OfficeDiffResult<OfficeTextToken> diff, OfficeChangeSetOptions? options = null) #Builds a change set from a word, line or character diff.
Parameters
- diff OfficeIMO.Diff.OfficeDiffResult<OfficeIMO.Diff.OfficeTextToken>
- options OfficeIMO.Diff.OfficeChangeSetOptions? = null
Returns
OfficeChangeSetpublic string ToJson(bool indented = true) #Serialises the change set to JSON with camel-case property names and string enum values.
Parameters
- indented bool = true
Returns
stringInherited Methods
Properties
public IReadOnlyList<OfficeChange> Changes { get; } #Changes in document order.
public bool IsComplete { get; } #True when the alignment ran to the end. Either way every difference is reported, because nothing is skipped when a limit is reached; when false, some unchanged text may appear as deleted and inserted again.