Table of Contents

Class MediaBlockJsonSerializer

Namespace
VisioForge.Core.MediaBlocks.Serialization
Assembly
VisioForge.Core.dll

Serializes and deserializes a single VisioForge.Core.MediaBlocks.Serialization.MediaBlockDocument to and from JSON with the same conventions as the pipeline document: camel-case names, stable integer type discriminator, unknown fields preserved. Serializing a live VisioForge.Core.MediaBlocks.IMediaBlock into a document requires the block catalog descriptors and is added in a later stage.

public static class MediaBlockJsonSerializer

Inheritance

Inherited Members

Methods

Load(string)

Deserializes a block document from JSON text. Malformed JSON or a wrong root shape throws JsonException.

public static MediaBlockDocument Load(string json)

Parameters

json string

The JSON text.

Returns

MediaBlockDocument

The deserialized block document.

LoadAsync(Stream)

Deserializes a block document from a stream.

public static Task<MediaBlockDocument> LoadAsync(Stream stream)

Parameters

stream Stream

The source stream positioned at the start of the JSON text.

Returns

Task<MediaBlockDocument>

The deserialized block document.

LoadFileAsync(string)

Deserializes a block document from a file.

public static Task<MediaBlockDocument> LoadFileAsync(string path)

Parameters

path string

The source file path.

Returns

Task<MediaBlockDocument>

The deserialized block document.

SaveFileAsync(MediaBlockDocument, string)

Saves a block document to a file.

public static Task SaveFileAsync(MediaBlockDocument block, string path)

Parameters

block MediaBlockDocument

The block document.

path string

The destination file path.

Returns

Task

Serialize(MediaBlockDocument)

Serializes a block document to a JSON string.

public static string Serialize(MediaBlockDocument block)

Parameters

block MediaBlockDocument

The block document.

Returns

string

The indented JSON text.

SerializeAsync(MediaBlockDocument, Stream)

Serializes a block document to a stream.

public static Task SerializeAsync(MediaBlockDocument block, Stream stream)

Parameters

block MediaBlockDocument

The block document.

stream Stream

The destination stream.

Returns

Task