static int _m_TryMapToBsonValue(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.ICustomBsonTypeMapper gen_to_be_invoked = (MongoDB.Bson.ICustomBsonTypeMapper)translator.FastGetCSObj(L, 1);



                {
                    object _value = translator.GetObject(L, 2, typeof(object));
                    MongoDB.Bson.BsonValue _bsonValue;

                    bool gen_ret = gen_to_be_invoked.TryMapToBsonValue(_value, out _bsonValue);
                    LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _bsonValue);



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



                {
                    System.Type _type = (System.Type)translator.GetObject(L, 1, typeof(System.Type));
                    MongoDB.Bson.ICustomBsonTypeMapper _customTypeMapper = (MongoDB.Bson.ICustomBsonTypeMapper)translator.GetObject(L, 2, typeof(MongoDB.Bson.ICustomBsonTypeMapper));

                    MongoDB.Bson.BsonTypeMapper.RegisterCustomTypeMapper(_type, _customTypeMapper);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }