Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Compiler.cs
Go to the documentation of this file.
5using System.IO;
9using System.Text;
10
12
13internal sealed class Compiler
14{
16
18
19 [RequiresUnreferencedCode("Reflects against input Type DeclaringType")]
21 {
22 if (type == null || TypeScope.IsKnownType(type) || types[type] != null)
23 {
24 return;
25 }
26 types[type] = type;
28 if (baseType != null)
29 {
31 }
33 if (declaringType != null)
34 {
36 }
37 Type[] interfaces = type.GetInterfaces();
38 foreach (Type type2 in interfaces)
39 {
41 }
42 ConstructorInfo[] constructors = type.GetConstructors();
43 for (int j = 0; j < constructors.Length; j++)
44 {
45 ParameterInfo[] parameters = constructors[j].GetParameters();
46 for (int k = 0; k < parameters.Length; k++)
47 {
48 AddImport(parameters[k].ParameterType, types);
49 }
50 }
51 if (type.IsGenericType)
52 {
54 for (int l = 0; l < genericArguments.Length; l++)
55 {
57 }
58 }
59 Module module = type.Module;
60 Assembly assembly = module.Assembly;
62 {
64 return;
65 }
66 object[] customAttributes = type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), inherit: false);
67 if (customAttributes.Length != 0)
68 {
71 }
72 }
73
75 {
76 }
77
78 internal void Close()
79 {
80 }
81
82 internal static string GetTempAssemblyName(AssemblyName parent, string ns)
83 {
84 return parent.Name + ".XmlSerializers" + (string.IsNullOrEmpty(ns) ? "" : $".{GetPersistentHashCode(ns)}");
85 }
86
87 private static uint GetPersistentHashCode(string value)
88 {
89 byte[] bytes = Encoding.UTF8.GetBytes(value);
90 byte[] array = SHA512.HashData(bytes);
92 }
93}
static uint ReadUInt32BigEndian(ReadOnlySpan< byte > source)
static CultureInfo InvariantCulture
static Assembly Load(string assemblyString)
Definition Assembly.cs:157
static byte[] HashData(byte[] source)
Definition SHA512.cs:66
static Encoding UTF8
Definition Encoding.cs:526
virtual Type[] GetGenericArguments()
Definition Type.cs:500
override? Type DeclaringType
Definition Type.cs:55
Type? BaseType
Definition Type.cs:295
Type[] GetInterfaces()
static string GetTempAssemblyName(AssemblyName parent, string ns)
Definition Compiler.cs:82
void AddImport(Type type, Hashtable types)
Definition Compiler.cs:20
readonly StringWriter _writer
Definition Compiler.cs:15
static uint GetPersistentHashCode(string value)
Definition Compiler.cs:87
void AddImport(Assembly assembly)
Definition Compiler.cs:74
static bool IsKnownType(Type type)
Definition TypeScope.cs:81