コード例 #1
0
        internal EventBridge GetEventBridge(EventType strType)
        {
            if (this._dic == null)
            {
                this._dic = new Dictionary <EventType, EventBridge>();
            }

            if (!this._dic.TryGetValue(strType, out EventBridge bridge))
            {
                bridge             = new EventBridge(this);
                this._dic[strType] = bridge;
            }
            return(bridge);
        }
コード例 #2
0
        static void GetChildEventBridges(EventType strType, Container container, List <EventBridge> bridges)
        {
            EventBridge bridge = container.TryGetEventBridge(strType);

            if (bridge != null)
            {
                bridges.Add(bridge);
            }
            if (container.gOwner != null)
            {
                bridge = container.gOwner.TryGetEventBridge(strType);
                if (bridge != null && !bridge.isEmpty)
                {
                    bridges.Add(bridge);
                }
            }

            int count = container.numChildren;

            for (int i = 0; i < count; ++i)
            {
                DisplayObject obj = container.GetChildAt(i);
                if (obj is Container container1)
                {
                    GetChildEventBridges(strType, container1, bridges);
                }
                else
                {
                    bridge = obj.TryGetEventBridge(strType);
                    if (bridge != null && !bridge.isEmpty)
                    {
                        bridges.Add(bridge);
                    }

                    if (obj.gOwner != null)
                    {
                        bridge = obj.gOwner.TryGetEventBridge(strType);
                        if (bridge != null && !bridge.isEmpty)
                        {
                            bridges.Add(bridge);
                        }
                    }
                }
            }
        }
コード例 #3
0
        internal void InternalSimpleCall(EventBridge bridge, EventType type, object data = null, BaseEventData eventData = null)
        {
            if (bridge == null || bridge.isEmpty)
            {
                return;
            }

            EventContext context = EventContext.Get();

            context.initiator = this;
            context.eventData = eventData;
            context.data      = data;

            bridge.CallCaptureInternal(context);
            bridge.CallInternal(context);

            context.Release();
        }