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
docxbyte[]The document to apply changes to.
Returns
- byte[]
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis 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
sourceStreamThe document to apply changes to. Read to its end; never disposed or sought.
destinationStreamReceives the result. Written; never disposed or sought.
ctCancellationTokenCancels before the document is read, and while it is written.
Returns
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis empty.- DocumentConversionException
It could not be read or written.
Inspect(byte[])
Reads the comments and tracked changes docx carries.
DocxReviewReport Inspect(byte[] docx)
Parameters
docxbyte[]The document to inspect.
Returns
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis 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
sourceStreamThe document to inspect. Read to its end; never disposed or sought.
ctCancellationTokenCancels before the document is read.
Returns
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis 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
docxbyte[]The document to discard changes from.
Returns
- byte[]
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis 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
sourceStreamThe document to discard changes from. Read to its end; never disposed or sought.
destinationStreamReceives the result. Written; never disposed or sought.
ctCancellationTokenCancels before the document is read, and while it is written.
Returns
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis empty.- DocumentConversionException
It could not be read or written.
RemoveComments(byte[])
A copy of docx with every comment removed.
byte[] RemoveComments(byte[] docx)
Parameters
docxbyte[]The document to clean.
Returns
- byte[]
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis 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
sourceStreamThe document to clean. Read to its end; never disposed or sought.
destinationStreamReceives the cleaned document. Written; never disposed or sought.
ctCancellationTokenCancels before the document is read, and while it is written.
Returns
Exceptions
- ArgumentNullException
docxis null.- ArgumentException
docxis empty.- DocumentConversionException
It could not be read or written.