Table of Contents

Struct MailDocumentBlockType

Namespace
MailFathom.Application.EmailContent.Rendering.Document
Assembly
MailFathom.Application.dll

The closed catalogue of blocks a reduced mail body may hold.

[JsonConverter(typeof(MailDocumentBlockTypeJsonConverter))]
public readonly record struct MailDocumentBlockType : IEquatable<MailDocumentBlockType>
Implements
Inherited Members

Remarks

Eight members and no ninth. The tree is built from markup a stranger wrote, so what a client draws has to be a set somebody reviewed rather than whatever the sender's document happened to contain: adding a member is a source change that reaches a review, and a client switches over the set exhaustively.

It is a closed enumeration rather than a C# enum for the reason PresentationBlockType is one — a member carries an identity the wire uses, which survives a rename of the C# member, and the revision of that block's own contract, which is what lets a client meeting a document from a newer service refuse the one block it does not know and render the rest of the message. A version is raised when that block's shape changes and never for a change elsewhere.

Being a struct, default is reachable and names no block; it reports itself through IsSpecified and is refused by the converter.

Fields

HeadingIdentity

The identity of the block holding a heading.

ImageIdentity

The identity of the block holding one image resolved from the message's own parts.

ListIdentity

The identity of the block holding a bulleted or numbered list.

ParagraphIdentity

The identity of the block holding one run of body text.

PreformattedIdentity

The identity of the block holding text whose own line breaks and spacing are the content.

QuoteIdentity

The identity of the block holding quoted history at its own depth.

SeparatorIdentity

The identity of the block holding a horizontal separator.

TableIdentity

The identity of the block holding a table, which is how mail layout is overwhelmingly built.

Properties

All

Gets every block type the catalogue holds.

Heading

Gets the type of the block holding a heading.

Identity

Gets the identity the wire uses, which survives a rename of the C# member.

Image

Gets the type of the block holding one image resolved from the message's own parts.

IsSpecified

Gets whether this value names a catalogued block rather than the unusable struct default.

List

Gets the type of the block holding a bulleted or numbered list.

Paragraph

Gets the type of the block holding one run of body text.

Preformatted

Gets the type of the block holding text whose own line breaks and spacing are the content.

Quote

Gets the type of the block holding quoted history at its own depth.

Separator

Gets the type of the block holding a horizontal separator.

Table

Gets the type of the block holding a table.

Version

Gets the revision of this block's own contract, which every block of the type carries.

Methods

ToString()

Returns the fully qualified type name of this instance.

TryParse(string?, out MailDocumentBlockType)

Parses an identity read off the wire.