DispatchEvent() public method

public DispatchEvent ( EventContext context ) : bool
context EventContext
return bool
 static public int DispatchEvent(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(FairyGUI.EventContext)))
         {
             FairyGUI.EventDispatcher self = (FairyGUI.EventDispatcher)checkSelf(l);
             FairyGUI.EventContext    a1;
             checkType(l, 2, out a1);
             var ret = self.DispatchEvent(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(string)))
         {
             FairyGUI.EventDispatcher self = (FairyGUI.EventDispatcher)checkSelf(l);
             System.String            a1;
             checkType(l, 2, out a1);
             var ret = self.DispatchEvent(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             FairyGUI.EventDispatcher self = (FairyGUI.EventDispatcher)checkSelf(l);
             System.String            a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             var ret = self.DispatchEvent(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             FairyGUI.EventDispatcher self = (FairyGUI.EventDispatcher)checkSelf(l);
             System.String            a1;
             checkType(l, 2, out a1);
             System.Object a2;
             checkType(l, 3, out a2);
             System.Object a3;
             checkType(l, 4, out a3);
             var ret = self.DispatchEvent(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #2
0
    static int DispatchEvent(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <FairyGUI.EventContext>(L, 2))
            {
                FairyGUI.EventDispatcher obj  = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                FairyGUI.EventContext    arg0 = (FairyGUI.EventContext)ToLua.ToObject(L, 2);
                bool o = obj.DispatchEvent(arg0);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string>(L, 2))
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                bool   o    = obj.DispatchEvent(arg0);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else if (count == 3)
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                object arg1 = ToLua.ToVarObject(L, 3);
                bool   o    = obj.DispatchEvent(arg0, arg1);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else if (count == 4)
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                object arg1 = ToLua.ToVarObject(L, 3);
                object arg2 = ToLua.ToVarObject(L, 4);
                bool   o    = obj.DispatchEvent(arg0, arg1, arg2);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventDispatcher.DispatchEvent"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }