コード例 #1
0
 public void Initialize(
     JsonSourceGenerationMode generationMode,
     string typeRef,
     string typeInfoPropertyName,
     Type type,
     ClassType classType,
     bool isValueType,
     JsonNumberHandling?numberHandling,
     List <PropertyGenerationSpec>?propertiesMetadata,
     CollectionType collectionType,
     TypeGenerationSpec?collectionKeyTypeMetadata,
     TypeGenerationSpec?collectionValueTypeMetadata,
     ObjectConstructionStrategy constructionStrategy,
     TypeGenerationSpec?nullableUnderlyingTypeMetadata,
     string?converterInstantiationLogic)
 {
     GenerationMode       = generationMode;
     TypeRef              = $"global::{typeRef}";
     TypeInfoPropertyName = typeInfoPropertyName;
     Type                           = type;
     ClassType                      = classType;
     IsValueType                    = isValueType;
     CanBeNull                      = !isValueType || nullableUnderlyingTypeMetadata != null;
     NumberHandling                 = numberHandling;
     PropertiesMetadata             = propertiesMetadata;
     CollectionType                 = collectionType;
     CollectionKeyTypeMetadata      = collectionKeyTypeMetadata;
     CollectionValueTypeMetadata    = collectionValueTypeMetadata;
     ConstructionStrategy           = constructionStrategy;
     NullableUnderlyingTypeMetadata = nullableUnderlyingTypeMetadata;
     ConverterInstantiationLogic    = converterInstantiationLogic;
 }
コード例 #2
0
 public void Initialize(
     JsonSourceGenerationMode generationMode,
     Type type,
     ClassType classType,
     JsonNumberHandling?numberHandling,
     List <PropertyGenerationSpec>?propertyGenSpecList,
     ParameterGenerationSpec[]?ctorParamGenSpecArray,
     CollectionType collectionType,
     TypeGenerationSpec?collectionKeyTypeMetadata,
     TypeGenerationSpec?collectionValueTypeMetadata,
     ObjectConstructionStrategy constructionStrategy,
     TypeGenerationSpec?nullableUnderlyingTypeMetadata,
     string?converterInstantiationLogic,
     bool implementsIJsonOnSerialized,
     bool implementsIJsonOnSerializing)
 {
     GenerationMode       = generationMode;
     TypeRef              = type.GetCompilableName();
     TypeInfoPropertyName = type.GetTypeInfoPropertyName();
     Type                           = type;
     ClassType                      = classType;
     IsValueType                    = type.IsValueType;
     CanBeNull                      = !IsValueType || nullableUnderlyingTypeMetadata != null;
     NumberHandling                 = numberHandling;
     PropertyGenSpecList            = propertyGenSpecList;
     CtorParamGenSpecArray          = ctorParamGenSpecArray;
     CollectionType                 = collectionType;
     CollectionKeyTypeMetadata      = collectionKeyTypeMetadata;
     CollectionValueTypeMetadata    = collectionValueTypeMetadata;
     ConstructionStrategy           = constructionStrategy;
     NullableUnderlyingTypeMetadata = nullableUnderlyingTypeMetadata;
     ConverterInstantiationLogic    = converterInstantiationLogic;
     ImplementsIJsonOnSerialized    = implementsIJsonOnSerialized;
     ImplementsIJsonOnSerializing   = implementsIJsonOnSerializing;
 }
コード例 #3
0
 public void Initialize(
     JsonSourceGenerationMode generationMode,
     Type type,
     ClassType classType,
     JsonNumberHandling?numberHandling,
     List <PropertyGenerationSpec>?propertyGenSpecList,
     ParameterGenerationSpec[]?ctorParamGenSpecArray,
     CollectionType collectionType,
     TypeGenerationSpec?collectionKeyTypeMetadata,
     TypeGenerationSpec?collectionValueTypeMetadata,
     ObjectConstructionStrategy constructionStrategy,
     TypeGenerationSpec?nullableUnderlyingTypeMetadata,
     string?runtimeTypeRef,
     TypeGenerationSpec?extensionDataPropertyTypeSpec,
     string?converterInstantiationLogic,
     bool implementsIJsonOnSerialized,
     bool implementsIJsonOnSerializing,
     bool hasTypeFactoryConverter,
     bool canContainNullableReferenceAnnotations,
     bool hasPropertyFactoryConverters,
     bool isPolymorphic)
 {
     GenerationMode       = generationMode;
     TypeRef              = type.GetCompilableName();
     TypeInfoPropertyName = type.GetTypeInfoPropertyName();
     Type                                   = type;
     ClassType                              = classType;
     IsValueType                            = type.IsValueType;
     CanBeNull                              = !IsValueType || nullableUnderlyingTypeMetadata != null;
     IsPolymorphic                          = isPolymorphic;
     NumberHandling                         = numberHandling;
     PropertyGenSpecList                    = propertyGenSpecList;
     CtorParamGenSpecArray                  = ctorParamGenSpecArray;
     CollectionType                         = collectionType;
     CollectionKeyTypeMetadata              = collectionKeyTypeMetadata;
     CollectionValueTypeMetadata            = collectionValueTypeMetadata;
     ConstructionStrategy                   = constructionStrategy;
     NullableUnderlyingTypeMetadata         = nullableUnderlyingTypeMetadata;
     RuntimeTypeRef                         = runtimeTypeRef;
     ExtensionDataPropertyTypeSpec          = extensionDataPropertyTypeSpec;
     ConverterInstantiationLogic            = converterInstantiationLogic;
     ImplementsIJsonOnSerialized            = implementsIJsonOnSerialized;
     ImplementsIJsonOnSerializing           = implementsIJsonOnSerializing;
     CanContainNullableReferenceAnnotations = canContainNullableReferenceAnnotations;
     HasTypeFactoryConverter                = hasTypeFactoryConverter;
     HasPropertyFactoryConverters           = hasPropertyFactoryConverters;
 }
コード例 #4
0
 private bool GenerationModeIsSpecified(JsonSourceGenerationMode mode) => GenerationMode == JsonSourceGenerationMode.Default || (mode & GenerationMode) != 0;