Zum Hauptinhalt springen

CkIdConverter<TKey>

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.Serialization

Converter for System.Text.Json and YamlDotNet for CkId<TElementId>

public class CkIdConverter<TKey> : JsonConverter<CkId<TKey>>, IYamlTypeConverter

Type Parameters​

TKey

Inheritance Object → JsonConverter → JsonConverter<CkId<TKey>> → CkIdConverter<TKey>
Implements IYamlTypeConverter

Properties​

HandleNull​

public bool HandleNull { get; }

Property Value​

Boolean

Type​

public Type Type { get; }

Property Value​

Type

Constructors​

CkIdConverter()​

public CkIdConverter()

Methods​

Accepts(Type)​

public bool Accepts(Type type)

Parameters​

type Type

Returns​

Boolean

ReadYaml(IParser, Type, ObjectDeserializer)​

public object ReadYaml(IParser parser, Type type, ObjectDeserializer rootDeserializer)

Parameters​

parser IParser

type Type

rootDeserializer ObjectDeserializer

Returns​

Object

WriteYaml(IEmitter, Object, Type, ObjectSerializer)​

public void WriteYaml(IEmitter emitter, object value, Type type, ObjectSerializer rootSerializer)

Parameters​

emitter IEmitter

value Object

type Type

rootSerializer ObjectSerializer

ReadAsPropertyName(out Utf8JsonReader, Type, JsonSerializerOptions)​

public CkId<TKey> ReadAsPropertyName(out Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters​

reader Utf8JsonReader

typeToConvert Type

options JsonSerializerOptions

Returns​

CkId<TKey>

WriteAsPropertyName(Utf8JsonWriter, CkId<TKey>, JsonSerializerOptions)​

public void WriteAsPropertyName(Utf8JsonWriter writer, CkId<TKey> value, JsonSerializerOptions options)

Parameters​

writer Utf8JsonWriter

value CkId<TKey>

options JsonSerializerOptions

Read(out Utf8JsonReader, Type, JsonSerializerOptions)​

public CkId<TKey> Read(out Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters​

reader Utf8JsonReader

typeToConvert Type

options JsonSerializerOptions

Returns​

CkId<TKey>

Write(Utf8JsonWriter, CkId<TKey>, JsonSerializerOptions)​

public void Write(Utf8JsonWriter writer, CkId<TKey> value, JsonSerializerOptions options)

Parameters​

writer Utf8JsonWriter

value CkId<TKey>

options JsonSerializerOptions