Class MediaBlockJsonSerializer
- 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 MediaBlockJsonSerializerInheritance
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
jsonstring-
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
streamStream-
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
pathstring-
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
blockMediaBlockDocument-
The block document.
pathstring-
The destination file path.
Returns
Serialize(MediaBlockDocument)
Serializes a block document to a JSON string.
public static string Serialize(MediaBlockDocument block)Parameters
blockMediaBlockDocument-
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
blockMediaBlockDocument-
The block document.
streamStream-
The destination stream.