Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeChangeSet

OfficeIMO.Diff

Namespace
OfficeIMO.Diff
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

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

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> required
Changes in document order.
oldSource string? = null optional
Name of the old document.
newSource string? = null optional
Name of the new document.
unit string = "word" optional
Token unit the changes were computed in, for example word or line.
isComplete bool = true optional
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 required

Returns

int
public 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> required
options OfficeIMO.Diff.OfficeChangeSetOptions? = null optional
public string ToJson(bool indented = true) #

Serialises the change set to JSON with camel-case property names and string enum values.

Parameters

indented bool = true optional

Returns

string

Properties

public IReadOnlyList<OfficeChange> Changes { get; } #

Changes in document order.

public string? OldSource { get; } #

Name of the old document.

public string? NewSource { get; } #

Name of the new document.

public string Unit { get; } #

Token unit the changes were computed in.

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.

public bool IsEmpty { get; } #

True when there are no changes.