# OfficeChangeSet

The changes between two documents in a format-neutral form, ready to serialise to JSON or render as a report.

Class 

`OfficeIMO.Diff`

**Namespace**

`OfficeIMO.Diff`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeChangeSet.cs:154](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L154)

**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

- Method [OfficeChangeSet.FromTextDiff](/api/core/officeimo-diff-officechangeset/#method-fromtextdiff-officeimo-diff-officediffresult-officeimo-diff-officetexttoken-officeimo-diff-officechangesetoptions)
- Property [OfficeDiffHtmlOptions.Changes](/api/core/officeimo-diff-officediffhtmloptions/#property-changes)

Filter members 

Show inherited

## Constructors

`public OfficeChangeSet(IEnumerable<OfficeChange> changes, string? oldSource = null, string? newSource = null, string unit = "word", bool isComplete = true)` [#](#constructor-ctor-collections-generic-ienumerable-officeimo-diff-officechange-string-string-string-boolean)

[OfficeChangeSet.cs:154](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L154)

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](/api/core/officeimo-diff-officechangeset/)).

## Methods

`public int Count(OfficeChangeKind kind)` [#](#method-count-officeimo-diff-officechangekind)

[OfficeChangeSet.cs:185](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L185)

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)` [#](#method-fromtextdiff-officeimo-diff-officediffresult-officeimo-diff-officetexttoken-officeimo-diff-officechangesetoptions)

[OfficeChangeSet.cs:189](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L189)

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**

Returns

`OfficeChangeSet`

`public string ToJson(bool indented = true)` [#](#method-tojson-boolean)

[OfficeChangeSet.cs:227](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L227)

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

Parameters

**indented bool = true optional**

Returns

`string`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<OfficeChange> Changes { get; }` [#](#property-changes)

[OfficeChangeSet.cs:164](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L164)

Changes in document order.

`public string? OldSource { get; }` [#](#property-oldsource)

[OfficeChangeSet.cs:167](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L167)

Name of the old document.

`public string? NewSource { get; }` [#](#property-newsource)

[OfficeChangeSet.cs:170](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L170)

Name of the new document.

`public string Unit { get; }` [#](#property-unit)

[OfficeChangeSet.cs:173](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L173)

Token unit the changes were computed in.

`public bool IsComplete { get; }` [#](#property-iscomplete)

[OfficeChangeSet.cs:179](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L179)

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; }` [#](#property-isempty)

[OfficeChangeSet.cs:182](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Diff/OfficeChangeSet.cs#L182)

True when there are no changes.

<!-- PowerForge markdown artifact sha256:8A91E998DB9FA5DC9D11E6CCA8E3F9CC6F4C0CD1AE057CC86EB8A8DE3057F051 -->
