Skip to content
ConsoleMonster
Class

RenderedOutput

ConsoleMonster.Export

Namespace
ConsoleMonster.Export
Assembly
ConsoleMonster
Modifiers
sealed

One rendered document or image: its format, its bytes and its media type.

Inheritance

  • object
  • RenderedOutput

Usage

Explore 5 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 5

Constructors

public RenderedOutput(OutputFormat format, byte[] bytes) #

Wraps rendered bytes.

Parameters

format ConsoleMonster.Export.OutputFormat required
The format.
bytes byte[] required
The encoded output.

Methods

public static string MediaTypeOf(OutputFormat format) #

The media type of a format.

Parameters

format ConsoleMonster.Export.OutputFormat required
The format.

Returns

string The media type.
public byte[] ToBytes() #

A copy of the encoded output (UTF-8 without a byte order mark for text).

Returns

byte[] The bytes.
public override string ToString() #

The text of a text format.

Returns

string The text, or the format name for an image.
public string ToText() #

The text of a text format.

Returns

string The text.

Exceptions

  • InvalidOperationException – The output is an image.

Properties

public OutputFormat Format { get; } #

The format.

public bool IsText { get; } #

Whether the output is text (everything except OutputFormat.Png).

public string MediaType { get; } #

The media type, such as image/svg+xml.