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

◆ InitializeBinaryFormatter()

bool System.Resources.ResourceReader.InitializeBinaryFormatter ( )
inlineprivate

Definition at line 208 of file ResourceReader.cs.

209 {
211 {
212 Type type = Type.GetType("System.Runtime.Serialization.Formatters.Binary.BinaryFormatter, System.Runtime.Serialization.Formatters", throwOnError: true);
213 MethodInfo method = type.GetMethod("Deserialize", new Type[1] { typeof(Stream) });
214 MethodInfo? method2 = typeof(ResourceReader).GetMethod("CreateUntypedDelegate", BindingFlags.Static | BindingFlags.NonPublic);
215 object obj;
216 if ((object)method2 == null)
217 {
218 obj = null;
219 }
220 else
221 {
222 MethodInfo methodInfo = method2.MakeGenericMethod(type);
223 object[] parameters = new MethodInfo[1] { method };
224 obj = methodInfo.Invoke(null, parameters);
225 }
229 }
230 Volatile.Write(ref _binaryFormatter, Activator.CreateInstance(s_binaryFormatterType));
231 return s_deserializeMethod != null;
232 }
static Func< object, Stream, object > s_deserializeMethod
ResourceReader(Stream stream, Dictionary< string, ResourceLocator > resCache, bool permitDeserialization)
static int CompareExchange(ref int location1, int value, int comparand)
static bool Read(ref bool location)
Definition Volatile.cs:67
static void Write(ref bool location, bool value)
Definition Volatile.cs:74

References System.Resources.ResourceReader._binaryFormatter, System.Threading.Interlocked.CompareExchange(), System.Activator.CreateInstance(), System.Type.GetType(), System.obj, System.Threading.Volatile.Read(), System.Resources.ResourceReader.s_binaryFormatterType, System.Resources.ResourceReader.s_deserializeMethod, System.type, System.value, and System.Threading.Volatile.Write().

Referenced by System.Resources.ResourceReader.DeserializeObject().