Table of Contents

Interface IDocxReview

Namespace
DocToolkit.Extensions.DependencyInjection
Assembly
DocToolkit.Extensions.DependencyInjection.dll

Reads and resolves a Word document's review state — the comments and tracked changes it carries from having been through review. Registered by AddDocToolkit(IServiceCollection, Action<DocToolkitOptions>?).

public interface IDocxReview

Remarks

Separate from IDocxEditor deliberately. That interface is about a document's content; this is about the record of people arguing over it.

Read and resolve only. There is no member here to add a comment or to record an edit as a tracked change — the core library cannot create review state, so neither can this.

Methods

AcceptRevisions(byte[])

A copy of docx with every tracked change applied: insertions kept, deletions dropped. Cannot be undone from the result.

byte[] AcceptRevisions(byte[] docx)

Parameters

docx byte[]

The document to apply changes to.

Returns

byte[]

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.

AcceptRevisionsAsync(Stream, Stream, CancellationToken)

A copy of docx with every tracked change applied: insertions kept, deletions dropped. Cannot be undone from the result.

Task AcceptRevisionsAsync(Stream source, Stream destination, CancellationToken ct = default)

Parameters

source Stream

The document to apply changes to. Read to its end; never disposed or sought.

destination Stream

Receives the result. Written; never disposed or sought.

ct CancellationToken

Cancels before the document is read, and while it is written.

Returns

Task

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.

Inspect(byte[])

Reads the comments and tracked changes docx carries.

DocxReviewReport Inspect(byte[] docx)

Parameters

docx byte[]

The document to inspect.

Returns

DocxReviewReport

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be opened or read.

InspectAsync(Stream, CancellationToken)

Reads the comments and tracked changes docx carries.

Task<DocxReviewReport> InspectAsync(Stream source, CancellationToken ct = default)

Parameters

source Stream

The document to inspect. Read to its end; never disposed or sought.

ct CancellationToken

Cancels before the document is read.

Returns

Task<DocxReviewReport>

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be opened or read.

RejectRevisions(byte[])

A copy of docx with every tracked change discarded: insertions dropped, deletions restored — the mirror of AcceptRevisions(byte[]). Cannot be undone from the result.

byte[] RejectRevisions(byte[] docx)

Parameters

docx byte[]

The document to discard changes from.

Returns

byte[]

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.

RejectRevisionsAsync(Stream, Stream, CancellationToken)

A copy of docx with every tracked change discarded: insertions dropped, deletions restored — the mirror of AcceptRevisions(byte[]). Cannot be undone from the result.

Task RejectRevisionsAsync(Stream source, Stream destination, CancellationToken ct = default)

Parameters

source Stream

The document to discard changes from. Read to its end; never disposed or sought.

destination Stream

Receives the result. Written; never disposed or sought.

ct CancellationToken

Cancels before the document is read, and while it is written.

Returns

Task

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.

RemoveComments(byte[])

A copy of docx with every comment removed.

byte[] RemoveComments(byte[] docx)

Parameters

docx byte[]

The document to clean.

Returns

byte[]

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.

RemoveCommentsAsync(Stream, Stream, CancellationToken)

A copy of docx with every comment removed.

Task RemoveCommentsAsync(Stream source, Stream destination, CancellationToken ct = default)

Parameters

source Stream

The document to clean. Read to its end; never disposed or sought.

destination Stream

Receives the cleaned document. Written; never disposed or sought.

ct CancellationToken

Cancels before the document is read, and while it is written.

Returns

Task

Exceptions

ArgumentNullException

docx is null.

ArgumentException

docx is empty.

DocumentConversionException

It could not be read or written.