Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetCompatibleGenericBaseClass()

static Type System.Text.Json.Reflection.ReflectionExtensions.GetCompatibleGenericBaseClass ( this Type type,
Type baseType,
Type objectType = null,
bool sourceGenType = false )
inlinestatic

Definition at line 13 of file ReflectionExtensions.cs.

14 {
15 if ((object)objectType == null)
16 {
17 objectType = typeof(object);
18 }
19 Type type2 = type;
20 while (type2 != null && type2 != typeof(object))
21 {
22 if (type2.IsGenericType)
23 {
24 Type genericTypeDefinition = type2.GetGenericTypeDefinition();
26 {
27 return type2;
28 }
29 }
30 type2 = type2.BaseType;
31 }
32 return null;
33 }
static bool OpenGenericTypesHaveSamePrefix(Type t1, Type t2)

References System.Text.Json.Dictionary, System.Text.Json.Reflection.ReflectionExtensions.OpenGenericTypesHaveSamePrefix(), and System.type.