FairyGUI.EventDispatcher.GetChainBridges C# (CSharp) Method

GetChainBridges() private method

private GetChainBridges ( string strType, List chain, bool bubble ) : void
strType string
chain List
bubble bool
return void
        internal void GetChainBridges(string strType, List<EventBridge> chain, bool bubble)
        {
            EventBridge bridge = TryGetEventBridge(strType);
            if (bridge != null && !bridge.isEmpty)
                chain.Add(bridge);

            if ((this is DisplayObject) && ((DisplayObject)this).gOwner != null)
            {
                bridge = ((DisplayObject)this).gOwner.TryGetEventBridge(strType);
                if (bridge != null && !bridge.isEmpty)
                    chain.Add(bridge);
            }

            if (!bubble)
                return;

            if (this is DisplayObject)
            {
                DisplayObject element = (DisplayObject)this;
                while ((element = element.parent) != null)
                {
                    bridge = element.TryGetEventBridge(strType);
                    if (bridge != null && !bridge.isEmpty)
                        chain.Add(bridge);

                    if (element.gOwner != null)
                    {
                        bridge = element.gOwner.TryGetEventBridge(strType);
                        if (bridge != null && !bridge.isEmpty)
                            chain.Add(bridge);
                    }
                }
            }
            else if (this is GObject)
            {
                GObject element = (GObject)this;
                while ((element = element.parent) != null)
                {
                    bridge = element.TryGetEventBridge(strType);
                    if (bridge != null && !bridge.isEmpty)
                        chain.Add(bridge);
                }
            }
        }

Usage Example

Example #1
0
        public void Move()
        {
            UpdateEvent();

            if (touchMonitors.Count > 0)
            {
                int len = touchMonitors.Count;
                for (int i = 0; i < len; i++)
                {
                    EventDispatcher e = touchMonitors[i];
                    if (e != null)
                    {
                        if ((e is DisplayObject) && ((DisplayObject)e).stage == null)
                        {
                            continue;
                        }
                        if ((e is GObject) && !((GObject)e).onStage)
                        {
                            continue;
                        }
                        e.GetChainBridges("onTouchMove", sHelperChain, false);
                    }
                }

                Stage.inst.BubbleEvent("onTouchMove", evt, sHelperChain);
                sHelperChain.Clear();
            }
            else
            {
                Stage.inst.onTouchMove.Call(evt);
            }
        }
All Usage Examples Of FairyGUI.EventDispatcher::GetChainBridges