# RtfDiagnostic

Describes a parser, binder, or writer condition discovered while processing RTF.

Class 

`OfficeIMO.Rtf.Diagnostics`

**Namespace**

`OfficeIMO.Rtf.Diagnostics`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfDiagnostic.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L10)

**Modifiers**

sealed

Describes a parser, binder, or writer condition discovered while processing RTF.

## Inheritance

- object
- RtfDiagnostic

## Usage

Explore 4 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 3

- Property [RtfReadResult.Diagnostics](/api/rtf/officeimo-rtf-rtfreadresult/#property-diagnostics)
- Property [RtfSyntaxTree.Diagnostics](/api/rtf/officeimo-rtf-syntax-rtfsyntaxtree/#property-diagnostics)
- Property [RtfTokenizeResult.Diagnostics](/api/rtf/officeimo-rtf-syntax-rtftokenizeresult/#property-diagnostics)

### Accepted by parameters 1

- Method [RtfConversionReport.AddReadDiagnostics](/api/rtf/officeimo-rtf-rtfconversionreport/#method-addreaddiagnostics-collections-generic-ienumerable-officeimo-rtf-diagnostics-rtfdiagnostic-string) parameter `diagnostics`

Filter members 

Show inherited

## Constructors

`public RtfDiagnostic(RtfDiagnosticSeverity severity, string code, string message, int position)` [#](#constructor-ctor-officeimo-rtf-diagnostics-rtfdiagnosticseverity-string-string-int32)

[RtfDiagnostic.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L10)

Initializes a new diagnostic.

Parameters

**severity OfficeIMO.Rtf.Diagnostics.RtfDiagnosticSeverity required**

**code string required**

**message string required**

**position int required**

## Methods

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

[RtfDiagnostic.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L30)

Returns a string that represents the current object.

Returns

`string` A string that represents the current object.

## 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`

## Properties

`public RtfDiagnosticSeverity Severity { get; }` [#](#property-severity)

[RtfDiagnostic.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L18)

Severity of the diagnostic.

`public string Code { get; }` [#](#property-code)

[RtfDiagnostic.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L21)

Stable diagnostic code.

`public string Message { get; }` [#](#property-message)

[RtfDiagnostic.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L24)

Human-readable diagnostic message.

`public int Position { get; }` [#](#property-position)

[RtfDiagnostic.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Diagnostics/RtfDiagnostic.cs#L27)

Zero-based input position associated with the diagnostic, when known.

<!-- PowerForge markdown artifact sha256:7F58031653F08FCEFC764C953E730A5E81C65DC1C5E62180BAFFA567210F06C9 -->
