2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 13:33:13 +00:00

ResourceProxy

This commit is contained in:
2019-07-24 02:52:03 +03:00
parent a2f4238933
commit 2caae61910
10 changed files with 63 additions and 61 deletions

View File

@ -21,6 +21,23 @@ namespace Esiur.Proxy
#endif
public static Type GetBaseType(object resource)
{
return GetBaseType(resource.GetType());
}
public static Type GetBaseType(Type type)
{
if (type.FullName.Contains("Esiur.Proxy.T"))
#if NETSTANDARD
return type.GetTypeInfo().BaseType;
#else
return type.BaseType;
#endif
else
return type;
}
public static Type GetProxy(Type type)
{
@ -95,23 +112,19 @@ namespace Esiur.Proxy
Label exitMethod = g.DefineLabel();
/*
IL_0000: ldarg.0
IL_0000: ldarg.0
IL_0001: call instance class [Esiur]Esiur.Resource.Instance [Esiur]Esiur.Resource.Resource::get_Instance()
// (no C# code)
IL_0006: dup
IL_0007: brtrue.s IL_000c
IL_0009: pop
// }
IL_000a: br.s IL_0017
// (no C# code)
IL_000c: ldstr "Level3"
IL_0011: call instance void [Esiur]Esiur.Resource.Instance::Modified(string)
IL_0016: nop
IL_0017: ret
*/
// Add IL code for set method