107 lines
3.4 KiB
C#
107 lines
3.4 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace System
|
|
{
|
|
// Token: 0x020006BC RID: 1724
|
|
[Serializable]
|
|
internal class UnitySerializationHolder : ISerializable, IObjectReference
|
|
{
|
|
// Token: 0x06004111 RID: 16657 RVA: 0x000DD6E4 File Offset: 0x000DB8E4
|
|
private UnitySerializationHolder(SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
this._data = info.GetString("Data");
|
|
this._unityType = (UnitySerializationHolder.UnityType)info.GetInt32("UnityType");
|
|
this._assemblyName = info.GetString("AssemblyName");
|
|
}
|
|
|
|
// Token: 0x06004112 RID: 16658 RVA: 0x000DD72C File Offset: 0x000DB92C
|
|
public static void GetTypeData(Type instance, SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
info.AddValue("Data", instance.FullName);
|
|
info.AddValue("UnityType", 4);
|
|
info.AddValue("AssemblyName", instance.Assembly.FullName);
|
|
info.SetType(typeof(UnitySerializationHolder));
|
|
}
|
|
|
|
// Token: 0x06004113 RID: 16659 RVA: 0x000DD77C File Offset: 0x000DB97C
|
|
public static void GetDBNullData(DBNull instance, SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
info.AddValue("Data", null);
|
|
info.AddValue("UnityType", 2);
|
|
info.AddValue("AssemblyName", instance.GetType().Assembly.FullName);
|
|
info.SetType(typeof(UnitySerializationHolder));
|
|
}
|
|
|
|
// Token: 0x06004114 RID: 16660 RVA: 0x000DD7CC File Offset: 0x000DB9CC
|
|
public static void GetAssemblyData(Assembly instance, SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
info.AddValue("Data", instance.FullName);
|
|
info.AddValue("UnityType", 6);
|
|
info.AddValue("AssemblyName", instance.FullName);
|
|
info.SetType(typeof(UnitySerializationHolder));
|
|
}
|
|
|
|
// Token: 0x06004115 RID: 16661 RVA: 0x000DD818 File Offset: 0x000DBA18
|
|
public static void GetModuleData(Module instance, SerializationInfo info, StreamingContext ctx)
|
|
{
|
|
info.AddValue("Data", instance.ScopeName);
|
|
info.AddValue("UnityType", 5);
|
|
info.AddValue("AssemblyName", instance.Assembly.FullName);
|
|
info.SetType(typeof(UnitySerializationHolder));
|
|
}
|
|
|
|
// Token: 0x06004116 RID: 16662 RVA: 0x000DD868 File Offset: 0x000DBA68
|
|
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
// Token: 0x06004117 RID: 16663 RVA: 0x000DD870 File Offset: 0x000DBA70
|
|
public virtual object GetRealObject(StreamingContext context)
|
|
{
|
|
switch (this._unityType)
|
|
{
|
|
case UnitySerializationHolder.UnityType.DBNull:
|
|
return DBNull.Value;
|
|
case UnitySerializationHolder.UnityType.Type:
|
|
{
|
|
Assembly assembly = Assembly.Load(this._assemblyName);
|
|
return assembly.GetType(this._data);
|
|
}
|
|
case UnitySerializationHolder.UnityType.Module:
|
|
{
|
|
Assembly assembly2 = Assembly.Load(this._assemblyName);
|
|
return assembly2.GetModule(this._data);
|
|
}
|
|
case UnitySerializationHolder.UnityType.Assembly:
|
|
return Assembly.Load(this._data);
|
|
}
|
|
throw new NotSupportedException(Locale.GetText("UnitySerializationHolder does not support this type."));
|
|
}
|
|
|
|
// Token: 0x04001A1D RID: 6685
|
|
private string _data;
|
|
|
|
// Token: 0x04001A1E RID: 6686
|
|
private UnitySerializationHolder.UnityType _unityType;
|
|
|
|
// Token: 0x04001A1F RID: 6687
|
|
private string _assemblyName;
|
|
|
|
// Token: 0x020006BD RID: 1725
|
|
private enum UnityType : byte
|
|
{
|
|
// Token: 0x04001A21 RID: 6689
|
|
DBNull = 2,
|
|
// Token: 0x04001A22 RID: 6690
|
|
Type = 4,
|
|
// Token: 0x04001A23 RID: 6691
|
|
Module,
|
|
// Token: 0x04001A24 RID: 6692
|
|
Assembly
|
|
}
|
|
}
|
|
}
|