Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros
DynamicAssemblies.cs
Go to the documentation of this file.
3
5
6internal static class DynamicAssemblies
7{
8 private static readonly Hashtable s_nameToAssemblyMap = new Hashtable();
9
10 private static readonly Hashtable s_assemblyToNameMap = new Hashtable();
11
13
14 internal static bool IsTypeDynamic(Type type)
15 {
17 if (obj == null)
18 {
19 Assembly assembly = type.Assembly;
20 bool flag = assembly.IsDynamic;
21 if (!flag)
22 {
23 if (type.IsArray)
24 {
25 flag = IsTypeDynamic(type.GetElementType());
26 }
27 else if (type.IsGenericType)
28 {
30 if (genericArguments != null)
31 {
32 foreach (Type type2 in genericArguments)
33 {
34 if (!(type2 == null) && !type2.IsGenericParameter)
35 {
36 flag = IsTypeDynamic(type2);
37 if (flag)
38 {
39 break;
40 }
41 }
42 }
43 }
44 }
45 }
46 obj = (s_tableIsTypeDynamic[type] = flag);
47 }
48 return (bool)obj;
49 }
50
51 internal static bool IsTypeDynamic(Type[] arguments)
52 {
53 foreach (Type type in arguments)
54 {
56 {
57 return true;
58 }
59 }
60 return false;
61 }
62
63 internal static void Add(Assembly a)
64 {
66 {
67 if (s_assemblyToNameMap[a] == null)
68 {
70 string text = null;
71 if (assembly == null)
72 {
73 text = a.FullName;
74 }
75 else if (assembly != a)
76 {
77 text = a.FullName + ", " + s_nameToAssemblyMap.Count;
78 }
79 if (text != null)
80 {
83 }
84 }
85 }
86 }
87
88 internal static Assembly Get(string fullName)
89 {
90 if (s_nameToAssemblyMap == null)
91 {
92 return null;
93 }
95 }
96
97 internal static string GetName(Assembly a)
98 {
99 if (s_assemblyToNameMap == null)
100 {
101 return null;
102 }
103 return (string)s_assemblyToNameMap[a];
104 }
105}
static Hashtable Synchronized(Hashtable table)
virtual Type[] GetGenericArguments()
Definition Type.cs:500
static bool IsTypeDynamic(Type[] arguments)
static Assembly Get(string fullName)
static readonly Hashtable s_nameToAssemblyMap