Search Results for

    Show / Hide Table of Contents

    Class IAnyImageJsonConverter

    Convert image to/from JSON

    Inheritance
    System.Object
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter
    Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter<IronSoftware.Abstractions.IAnyImage>
    IAnyImageJsonConverter
    Inherited Members
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter.WriteJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonWriter, Object, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter.ReadJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonReader, Type, Object, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter.CanConvert(Type)
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter.CanRead
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter.CanWrite
    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public class IAnyImageJsonConverter :  < af9ee0c5 - a8cb - 435  a - 8f  c7 - 7f  3f  1  c1a3657 > JsonConverter < IAnyImage >

    IAnyImageJsonConverter is the Newtonsoft.Json converter that serializes and deserializes an IAnyImage when IronWord reads or writes its object model as JSON. It is the bridge that lets an image-bearing element survive a round trip through JSON, rather than something application code calls directly.

    The converter extends Newtonsoft's generic JsonConverter<IAnyImage> and overrides the two members that type does: WriteJson emits an IAnyImage into a JSON writer, and ReadJson reconstructs one from a JSON reader. Newtonsoft invokes these during serialization, so the usual way to use the converter is to register it on the serializer settings; you rarely call ReadJson or WriteJson yourself. This matters when you persist or transmit a document fragment that carries an image and need the image content preserved across the conversion.

    JsonConvert.SerializeObject(element, new IAnyImageJsonConverter());

    The add image how-to covers placing images, and the object tree example shows the model these images sit within.

    Constructors

    IAnyImageJsonConverter()

    Declaration
    public IAnyImageJsonConverter()

    Methods

    ReadJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonReader, Type, IAnyImage, Boolean, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)

    Declaration
    public override IAnyImage ReadJson( < af9ee0c5 - a8cb - 435  a - 8f  c7 - 7f  3f  1  c1a3657 > JsonReader reader, Type objectType, IAnyImage existingValue, bool hasExistingValue,  < af9ee0c5 - a8cb - 435  a - 8f  c7 - 7f  3f  1  c1a3657 > JsonSerializer serializer)
    Parameters
    Type Name Description
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonReader reader
    System.Type objectType
    IronSoftware.Abstractions.IAnyImage existingValue
    System.Boolean hasExistingValue
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer serializer
    Returns
    Type Description
    IronSoftware.Abstractions.IAnyImage
    Overrides
    Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter<IronSoftware.Abstractions.IAnyImage>.ReadJson(Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonReader, System.Type, IronSoftware.Abstractions.IAnyImage, System.Boolean, Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)

    WriteJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonWriter, IAnyImage, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)

    Declaration
    public override void WriteJson( < af9ee0c5 - a8cb - 435  a - 8f  c7 - 7f  3f  1  c1a3657 > JsonWriter writer, IAnyImage value,  < af9ee0c5 - a8cb - 435  a - 8f  c7 - 7f  3f  1  c1a3657 > JsonSerializer serializer)
    Parameters
    Type Name Description
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonWriter writer
    IronSoftware.Abstractions.IAnyImage value
    <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer serializer
    Overrides
    Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonConverter<IronSoftware.Abstractions.IAnyImage>.WriteJson(Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonWriter, IronSoftware.Abstractions.IAnyImage, Newtonsoft.Json.<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)

    Inherited members

    WriteJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonWriter, Object, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)
    ReadJson(<af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonReader, Type, Object, <af9ee0c5-a8cb-435a-8fc7-7f3f1c1a3657>JsonSerializer)
    CanConvert(Type)
    CanRead
    CanWrite
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet