forked from Ourpalm/ILRuntime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
819 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
ILRuntimeTest/AutoGenerate/ILRuntimeTest_TestMainForm_Binding.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
using ILRuntime.CLR.TypeSystem; | ||
using ILRuntime.CLR.Method; | ||
using ILRuntime.Runtime.Enviorment; | ||
using ILRuntime.Runtime.Intepreter; | ||
using ILRuntime.Runtime.Stack; | ||
using ILRuntime.Reflection; | ||
using ILRuntime.CLR.Utils; | ||
|
||
namespace ILRuntime.Runtime.Generated | ||
{ | ||
unsafe class ILRuntimeTest_TestMainForm_Binding | ||
{ | ||
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app) | ||
{ | ||
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; | ||
FieldInfo field; | ||
Type[] args; | ||
Type type = typeof(ILRuntimeTest.TestMainForm); | ||
|
||
field = type.GetField("_app", flag); | ||
app.RegisterCLRFieldGetter(field, get__app_0); | ||
app.RegisterCLRFieldSetter(field, set__app_0); | ||
|
||
|
||
} | ||
|
||
|
||
|
||
static object get__app_0(ref object o) | ||
{ | ||
return ILRuntimeTest.TestMainForm._app; | ||
} | ||
static void set__app_0(ref object o, object v) | ||
{ | ||
ILRuntimeTest.TestMainForm._app = (ILRuntime.Runtime.Enviorment.AppDomain)v; | ||
} | ||
|
||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
ILRuntimeTest/AutoGenerate/ILRuntime_CLR_TypeSystem_IType_Binding.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
using ILRuntime.CLR.TypeSystem; | ||
using ILRuntime.CLR.Method; | ||
using ILRuntime.Runtime.Enviorment; | ||
using ILRuntime.Runtime.Intepreter; | ||
using ILRuntime.Runtime.Stack; | ||
using ILRuntime.Reflection; | ||
using ILRuntime.CLR.Utils; | ||
|
||
namespace ILRuntime.Runtime.Generated | ||
{ | ||
unsafe class ILRuntime_CLR_TypeSystem_IType_Binding | ||
{ | ||
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app) | ||
{ | ||
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; | ||
MethodBase method; | ||
Type[] args; | ||
Type type = typeof(ILRuntime.CLR.TypeSystem.IType); | ||
args = new Type[]{}; | ||
method = type.GetMethod("get_ReflectionType", flag, null, args, null); | ||
app.RegisterCLRMethodRedirection(method, get_ReflectionType_0); | ||
|
||
|
||
} | ||
|
||
|
||
static StackObject* get_ReflectionType_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj) | ||
{ | ||
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; | ||
StackObject* ptr_of_this_method; | ||
StackObject* __ret = ILIntepreter.Minus(__esp, 1); | ||
|
||
ptr_of_this_method = ILIntepreter.Minus(__esp, 1); | ||
ILRuntime.CLR.TypeSystem.IType instance_of_this_method = (ILRuntime.CLR.TypeSystem.IType)typeof(ILRuntime.CLR.TypeSystem.IType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); | ||
__intp.Free(ptr_of_this_method); | ||
|
||
var result_of_this_method = instance_of_this_method.ReflectionType; | ||
|
||
object obj_result_of_this_method = result_of_this_method; | ||
if(obj_result_of_this_method is CrossBindingAdaptorType) | ||
{ | ||
return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance); | ||
} | ||
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); | ||
} | ||
|
||
|
||
|
||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
ILRuntimeTest/AutoGenerate/ILRuntime_Runtime_Enviorment_AppDomain_Binding.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
using ILRuntime.CLR.TypeSystem; | ||
using ILRuntime.CLR.Method; | ||
using ILRuntime.Runtime.Enviorment; | ||
using ILRuntime.Runtime.Intepreter; | ||
using ILRuntime.Runtime.Stack; | ||
using ILRuntime.Reflection; | ||
using ILRuntime.CLR.Utils; | ||
|
||
namespace ILRuntime.Runtime.Generated | ||
{ | ||
unsafe class ILRuntime_Runtime_Enviorment_AppDomain_Binding | ||
{ | ||
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app) | ||
{ | ||
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; | ||
MethodBase method; | ||
Type[] args; | ||
Type type = typeof(ILRuntime.Runtime.Enviorment.AppDomain); | ||
args = new Type[]{}; | ||
method = type.GetMethod("get_LoadedTypes", flag, null, args, null); | ||
app.RegisterCLRMethodRedirection(method, get_LoadedTypes_0); | ||
|
||
|
||
} | ||
|
||
|
||
static StackObject* get_LoadedTypes_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj) | ||
{ | ||
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; | ||
StackObject* ptr_of_this_method; | ||
StackObject* __ret = ILIntepreter.Minus(__esp, 1); | ||
|
||
ptr_of_this_method = ILIntepreter.Minus(__esp, 1); | ||
ILRuntime.Runtime.Enviorment.AppDomain instance_of_this_method = (ILRuntime.Runtime.Enviorment.AppDomain)typeof(ILRuntime.Runtime.Enviorment.AppDomain).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack)); | ||
__intp.Free(ptr_of_this_method); | ||
|
||
var result_of_this_method = instance_of_this_method.LoadedTypes; | ||
|
||
object obj_result_of_this_method = result_of_this_method; | ||
if(obj_result_of_this_method is CrossBindingAdaptorType) | ||
{ | ||
return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance); | ||
} | ||
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); | ||
} | ||
|
||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
using ILRuntime.CLR.TypeSystem; | ||
using ILRuntime.CLR.Method; | ||
using ILRuntime.Runtime.Enviorment; | ||
using ILRuntime.Runtime.Intepreter; | ||
using ILRuntime.Runtime.Stack; | ||
using ILRuntime.Reflection; | ||
using ILRuntime.CLR.Utils; | ||
|
||
namespace ILRuntime.Runtime.Generated | ||
{ | ||
unsafe class System_Char_Binding | ||
{ | ||
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app) | ||
{ | ||
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; | ||
MethodBase method; | ||
Type[] args; | ||
Type type = typeof(System.Char); | ||
args = new Type[]{}; | ||
method = type.GetMethod("ToString", flag, null, args, null); | ||
app.RegisterCLRMethodRedirection(method, ToString_0); | ||
|
||
|
||
} | ||
|
||
static System.Char GetInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack) | ||
{ | ||
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); | ||
System.Char instance_of_this_method; | ||
switch(ptr_of_this_method->ObjectType) | ||
{ | ||
case ObjectTypes.FieldReference: | ||
{ | ||
var instance_of_fieldReference = __mStack[ptr_of_this_method->Value]; | ||
if(instance_of_fieldReference is ILTypeInstance) | ||
{ | ||
instance_of_this_method = (System.Char)typeof(System.Char).CheckCLRTypes(((ILTypeInstance)instance_of_fieldReference)[ptr_of_this_method->ValueLow]); | ||
} | ||
else | ||
{ | ||
var t = __domain.GetType(instance_of_fieldReference.GetType()) as CLRType; | ||
instance_of_this_method = (System.Char)t.GetFieldValue(ptr_of_this_method->ValueLow, instance_of_fieldReference); | ||
} | ||
} | ||
break; | ||
case ObjectTypes.StaticFieldReference: | ||
{ | ||
var t = __domain.GetType(ptr_of_this_method->Value); | ||
if(t is ILType) | ||
{ | ||
instance_of_this_method = (System.Char)typeof(System.Char).CheckCLRTypes(((ILType)t).StaticInstance[ptr_of_this_method->ValueLow]); | ||
} | ||
else | ||
{ | ||
instance_of_this_method = (System.Char)((CLRType)t).GetFieldValue(ptr_of_this_method->ValueLow, null); | ||
} | ||
} | ||
break; | ||
case ObjectTypes.ArrayReference: | ||
{ | ||
var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Char[]; | ||
instance_of_this_method = instance_of_arrayReference[ptr_of_this_method->ValueLow]; | ||
} | ||
break; | ||
default: | ||
instance_of_this_method = (char)ptr_of_this_method->Value; | ||
break; | ||
} | ||
return instance_of_this_method; | ||
} | ||
|
||
static StackObject* ToString_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj) | ||
{ | ||
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; | ||
StackObject* ptr_of_this_method; | ||
StackObject* __ret = ILIntepreter.Minus(__esp, 1); | ||
|
||
ptr_of_this_method = ILIntepreter.Minus(__esp, 1); | ||
System.Char instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack); | ||
|
||
var result_of_this_method = instance_of_this_method.ToString(); | ||
|
||
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); | ||
} | ||
|
||
|
||
|
||
} | ||
} |
Oops, something went wrong.