Exemple #1
0
        private static PropagationPaths BuildPropagationPath(VisualElement elem, PropagationPaths.Type pathTypesRequested)
        {
            if (elem == null || pathTypesRequested == PropagationPaths.Type.None)
            {
                return(null);
            }
            var ret = PropagationPathsPool.Acquire();

            while (elem.shadow.parent != null)
            {
                if (elem.shadow.parent.enabledInHierarchy)
                {
                    if ((pathTypesRequested & PropagationPaths.Type.Capture) == PropagationPaths.Type.Capture && elem.shadow.parent.HasCaptureHandlers())
                    {
                        ret.capturePath.Add(elem.shadow.parent);
                    }
                    if ((pathTypesRequested & PropagationPaths.Type.BubbleUp) == PropagationPaths.Type.BubbleUp && elem.shadow.parent.HasBubbleHandlers())
                    {
                        ret.bubblePath.Add(elem.shadow.parent);
                    }
                }
                elem = elem.shadow.parent;
            }
            return(ret);
        }
Exemple #2
0
 public void Dispose()
 {
     PropagationPathsPool.Release(this);
 }