FairyGUI.EventDispatcher.DispatchEvent C# (CSharp) Method

DispatchEvent() public method

public DispatchEvent ( EventContext context ) : bool
context EventContext
return bool
        public bool DispatchEvent(EventContext context)
        {
            EventBridge bridge = TryGetEventBridge(context.type);
            EventBridge gBridge = null;
            if ((this is DisplayObject) && ((DisplayObject)this).gOwner != null)
                gBridge = ((DisplayObject)this).gOwner.TryGetEventBridge(context.type);

            EventDispatcher savedSender = context.sender;

            if (bridge != null && !bridge.isEmpty)
            {
                bridge.CallCaptureInternal(context);
                bridge.CallInternal(context);
            }

            if (gBridge != null && !gBridge.isEmpty)
            {
                gBridge.CallCaptureInternal(context);
                gBridge.CallInternal(context);
            }

            context.sender = savedSender;
            return context._defaultPrevented;
        }

Same methods

EventDispatcher::DispatchEvent ( string strType ) : bool
EventDispatcher::DispatchEvent ( string strType, object data ) : bool
EventDispatcher::DispatchEvent ( string strType, object data, object initiator ) : bool

Usage Example

 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));
     }
 }
All Usage Examples Of FairyGUI.EventDispatcher::DispatchEvent