Пример #1
0
        /// <summary>
        /// Delegate that is called on lua hook callback
        /// </summary>
        /// <param name = "luaState">lua state</param>
        /// <param name = "luaDebug">Pointer to LuaDebug (lua_debug) structure</param>
        /// <author>Reinhard Ostermeier</author>
        private void DebugHookCallback(LuaCore.lua_State luaState, IntPtr ar)
        {
            if (ar == IntPtr.Zero)
            {
                return;
            }
            LuaCore.lua_Debug luaDebug = Marshal.PtrToStructure <LuaCore.lua_Debug>(ar);
            try
            {
                var temp = DebugHook;

                if (!temp.IsNull())
                {
                    temp(this, new DebugHookEventArgs(luaDebug));
                }
            }
            catch (Exception ex)
            {
                OnHookException(new HookExceptionEventArgs(ex));
            }
        }
Пример #2
0
 public DebugHookEventArgs(LuaCore.lua_Debug luaDebug)
 {
     this.luaDebug = luaDebug;
 }
Пример #3
0
 /// <summary>
 /// Sets local (see lua docs)
 /// </summary>
 /// <param name = "luaDebug">lua debug structure</param>
 /// <param name = "n">see lua docs</param>
 /// <returns>see lua docs</returns>
 /// <author>Reinhard Ostermeier</author>
 public string SetLocal(LuaCore.lua_Debug luaDebug, int n)
 {
     return(LuaCore.lua_setlocal(luaState, luaDebug, n).ToString());
 }