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
optionsJsonSerializerOptionsThe 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
Byte
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<byte> Byte { get; }
Property Value
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
public static SourceGenerationContext Default { get; }
Property Value
DicomDataset
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomDataset> DicomDataset { get; }
Property Value
DicomDatasetArray
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomDataset[]> DicomDatasetArray { get; }
Property Value
DicomDictionaryEntry
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomDictionaryEntry> DicomDictionaryEntry { get; }
Property Value
DicomItem
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomItem> DicomItem { get; }
Property Value
DicomMaskedTag
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomMaskedTag> DicomMaskedTag { get; }
Property Value
DicomPrivateCreator
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomPrivateCreator> DicomPrivateCreator { get; }
Property Value
DicomTag
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomTag> DicomTag { get; }
Property Value
DicomVM
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomVM> DicomVM { get; }
Property Value
DicomVR
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomVR> DicomVR { get; }
Property Value
DicomVRArray
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DicomVR[]> DicomVRArray { get; }
Property Value
GeneratedSerializerOptions
The source-generated options associated with this context.
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }
Property Value
Int32
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<int> Int32 { get; }
Property Value
String
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<string> String { get; }
Property Value
Type
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<Type> Type { get; }
Property Value
UInt16
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<ushort> UInt16 { get; }
Property Value
UInt32
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<uint> UInt32 { get; }
Property Value
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
formatIndentedboolconvertersIEnumerable<JsonConverter>
Returns
Create(bool, params JsonConverter[])
public static SourceGenerationContext Create(bool formatIntended, params JsonConverter[] converters)
Parameters
formatIntendedboolconvertersJsonConverter[]
Returns
GetTypeInfo(Type)
Gets metadata for the specified type.
public override JsonTypeInfo? GetTypeInfo(Type type)
Parameters
typeTypeThe type to fetch metadata for.
Returns
- JsonTypeInfo
The metadata for the specified type, or null if the context has no metadata for the type.