Example #1
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    MongoDB.Bson.Serialization.Attributes.BsonIgnoreExtraElementsAttribute gen_ret = new MongoDB.Bson.Serialization.Attributes.BsonIgnoreExtraElementsAttribute();
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
                {
                    bool _ignoreExtraElements = LuaAPI.lua_toboolean(L, 2);

                    MongoDB.Bson.Serialization.Attributes.BsonIgnoreExtraElementsAttribute gen_ret = new MongoDB.Bson.Serialization.Attributes.BsonIgnoreExtraElementsAttribute(_ignoreExtraElements);
                    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.Attributes.BsonIgnoreExtraElementsAttribute constructor!"));
        }