Table of Contents

Class SourceGenerationContext

Namespace
FellowOakDicom.Serialization
Assembly
fo-dicom.core.dll
[JsonSerializable(typeof(DicomDataset))]
[JsonSerializable(typeof(DicomDataset[]))]
public class SourceGenerationContext : JsonSerializerContext, IJsonTypeInfoResolver
Inheritance
SourceGenerationContext
Implements
Inherited Members
Extension Methods

Constructors

SourceGenerationContext()

public SourceGenerationContext()

SourceGenerationContext(JsonSerializerOptions)

Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.

public SourceGenerationContext(JsonSerializerOptions options)

Parameters

options JsonSerializerOptions

The run time provided options for the context instance.

Properties

Boolean

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<bool> Boolean { get; }

Property Value

JsonTypeInfo<bool>

Byte

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<byte> Byte { get; }

Property Value

JsonTypeInfo<byte>

Default

The default JsonSerializerContext associated with a default JsonSerializerOptions instance.

public static SourceGenerationContext Default { get; }

Property Value

SourceGenerationContext

DicomDataset

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomDataset> DicomDataset { get; }

Property Value

JsonTypeInfo<DicomDataset>

DicomDatasetArray

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomDataset[]> DicomDatasetArray { get; }

Property Value

JsonTypeInfo<DicomDataset[]>

DicomDictionaryEntry

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomDictionaryEntry> DicomDictionaryEntry { get; }

Property Value

JsonTypeInfo<DicomDictionaryEntry>

DicomItem

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomItem> DicomItem { get; }

Property Value

JsonTypeInfo<DicomItem>

DicomMaskedTag

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomMaskedTag> DicomMaskedTag { get; }

Property Value

JsonTypeInfo<DicomMaskedTag>

DicomPrivateCreator

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomPrivateCreator> DicomPrivateCreator { get; }

Property Value

JsonTypeInfo<DicomPrivateCreator>

DicomTag

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomTag> DicomTag { get; }

Property Value

JsonTypeInfo<DicomTag>

DicomVM

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomVM> DicomVM { get; }

Property Value

JsonTypeInfo<DicomVM>

DicomVR

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomVR> DicomVR { get; }

Property Value

JsonTypeInfo<DicomVR>

DicomVRArray

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DicomVR[]> DicomVRArray { get; }

Property Value

JsonTypeInfo<DicomVR[]>

GeneratedSerializerOptions

The source-generated options associated with this context.

protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }

Property Value

JsonSerializerOptions

Int32

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<int> Int32 { get; }

Property Value

JsonTypeInfo<int>

String

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<string> String { get; }

Property Value

JsonTypeInfo<string>

Type

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<Type> Type { get; }

Property Value

JsonTypeInfo<Type>

UInt16

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<ushort> UInt16 { get; }

Property Value

JsonTypeInfo<ushort>

UInt32

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<uint> UInt32 { get; }

Property Value

JsonTypeInfo<uint>

Methods

Create(bool, IEnumerable<JsonConverter>)

[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "The returned options will be populated with a JsonSerializerContext")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "The returned options will be populated with a JsonSerializerContext")]
public static SourceGenerationContext Create(bool formatIndented, IEnumerable<JsonConverter> converters)

Parameters

formatIndented bool
converters IEnumerable<JsonConverter>

Returns

SourceGenerationContext

Create(bool, params JsonConverter[])

public static SourceGenerationContext Create(bool formatIntended, params JsonConverter[] converters)

Parameters

formatIntended bool
converters JsonConverter[]

Returns

SourceGenerationContext

GetTypeInfo(Type)

Gets metadata for the specified type.

public override JsonTypeInfo? GetTypeInfo(Type type)

Parameters

type Type

The type to fetch metadata for.

Returns

JsonTypeInfo

The metadata for the specified type, or null if the context has no metadata for the type.