Example #1
0
        static int _m_CreateCLRInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                ILRuntimeDemo.TestClassBaseAdapter gen_to_be_invoked = (ILRuntimeDemo.TestClassBaseAdapter)translator.FastGetCSObj(L, 1);



                {
                    ILRuntime.Runtime.Enviorment.AppDomain      _appdomain = (ILRuntime.Runtime.Enviorment.AppDomain)translator.GetObject(L, 2, typeof(ILRuntime.Runtime.Enviorment.AppDomain));
                    ILRuntime.Runtime.Intepreter.ILTypeInstance _instance  = (ILRuntime.Runtime.Intepreter.ILTypeInstance)translator.GetObject(L, 3, typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance));

                    var gen_ret = gen_to_be_invoked.CreateCLRInstance(_appdomain, _instance);
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #2
0
        static int _g_get_BaseCLRType(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                ILRuntimeDemo.TestClassBaseAdapter gen_to_be_invoked = (ILRuntimeDemo.TestClassBaseAdapter)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.BaseCLRType);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Example #3
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    var gen_ret = new ILRuntimeDemo.TestClassBaseAdapter();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to ILRuntimeDemo.TestClassBaseAdapter constructor!"));
        }