Class ConversionResult<T>
- Namespace
- DocToolkit
- Assembly
- DocToolkit.Primitives.dll
A converted document together with everything the conversion could not carry across.
public sealed class ConversionResult<T>
Type Parameters
TThe converted document's type.
- Inheritance
-
ConversionResult<T>
- Inherited Members
Remarks
Returned only by the ConvertWithReport overloads. The plain Convert overloads are
unchanged and still return the value on its own — this type is opt-in, and adding it broke no
existing caller.
There is no Succeeded property. The underlying converters have one, but a
DocToolkit conversion that did not succeed throws DocumentConversionException, so
it would be true on every instance a caller could ever hold — a constant
dressed as data.
Properties
HasLoss
Whether anything was actually lost — that is, whether Warnings holds an entry whose Kind is not None.
public bool HasLoss { get; }
Property Value
Remarks
Derived from Warnings rather than copied from the underlying converter's own
flag, so the two can never disagree in front of a caller. A HasLoss of
true beside an empty warning list produces bug reports nobody can
reproduce.
Value
The converted document. Usable whatever HasLoss says.
public T Value { get; }
Property Value
- T
Warnings
Everything the conversion could not carry across, in the order the converter reported it. Empty when nothing was lost.
public IReadOnlyList<ConversionWarning> Warnings { get; }