Exemplo n.º 1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3)) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    string _elementName = LuaAPI.lua_tostring(L, 2);
                    long   _flag        = LuaAPI.lua_toint64(L, 3);
                    bool   _isOptional  = LuaAPI.lua_toboolean(L, 4);

                    MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member gen_ret = new MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member(_elementName, _flag, _isOptional);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isint64(L, 3)))
                {
                    string _elementName = LuaAPI.lua_tostring(L, 2);
                    long   _flag        = LuaAPI.lua_toint64(L, 3);

                    MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member gen_ret = new MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member(_elementName, _flag);
                    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 MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member constructor!"));
        }
Exemplo n.º 2
0
        static int _g_get_ElementName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member gen_to_be_invoked = (MongoDB.Bson.Serialization.Serializers.SerializerHelper.Member)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.ElementName);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }