Esempio n. 1
0
        private IEnumerable <UiNode> EnumerateNodes(UiNodePath path, int level)
        {
            UiNodePathElement element = path[level];

            if (element == null)
            {
                yield break;
            }

            foreach (UiNode node in GetChilds().Where(node => element.IsMatch(node)))
            {
                if (path.IsLast(level))
                {
                    yield return(node);
                }
                else
                {
                    UiContainerNode container = node as UiContainerNode;
                    if (container == null)
                    {
                        continue;
                    }

                    foreach (UiNode child in container.EnumerateNodes(path, level + 1))
                    {
                        yield return(child);
                    }
                }
            }
        }
Esempio n. 2
0
 public void Add(UiNodePathElement element)
 {
     _elements.Add(element);
 }