Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EnumConverterFactory.cs
Go to the documentation of this file.
2
4
6{
7 public override bool CanConvert(Type type)
8 {
9 return type.IsEnum;
10 }
11
16
21
26
27 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2055:MakeGenericType", Justification = "'EnumConverter<T> where T : struct' implies 'T : new()', so the trimmer is warning calling MakeGenericType here because enumType's constructors are not annotated. But EnumConverter doesn't call new T(), so this is safe.")]
30 {
31 return typeof(EnumConverter<>).MakeGenericType(enumType);
32 }
33}
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
Definition Activator.cs:17
static JsonConverter Create(Type enumType, EnumConverterOptions converterOptions, JsonNamingPolicy namingPolicy, JsonSerializerOptions serializerOptions)
override JsonConverter CreateConverter(Type type, JsonSerializerOptions options)
static JsonConverter Create(Type enumType, EnumConverterOptions converterOptions, JsonSerializerOptions serializerOptions)