Exemplo n.º 1
0
        public IEnumerable <IUiLeaf> EnumerateCheckedLeafs(Wildcard wildcard, bool parentChecked)
        {
            foreach (UiNode node in GetChilds())
            {
                if (!parentChecked && node.IsChecked == false)
                {
                    continue;
                }

                // Родительский контейнер может быть помечен, а вложенный нет
                // Это сделано специально для отложенной загрузки вложенных элементов
                bool isChecked = parentChecked || node.IsChecked == true;

                UiContainerNode container = node as UiContainerNode;
                if (container != null)
                {
                    foreach (IUiLeaf child in container.EnumerateCheckedLeafs(wildcard, isChecked))
                    {
                        yield return(child);
                    }
                }
                else
                {
                    IUiLeaf leaf = node as IUiLeaf;
                    if (leaf != null && isChecked && wildcard.IsMatch(leaf.Name))
                    {
                        yield return(leaf);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void OnSelectedLeafChanged(IUiLeaf leaf)
        {
            HideControls();

            UiWpdTableLeaf wpdLeaf = leaf as UiWpdTableLeaf;
            if (wpdLeaf != null)
            {
                OnWpdLeafSelected(wpdLeaf);
                return;
            }

            UiArchiveLeaf archiveLeaf = leaf as UiArchiveLeaf;
            if (archiveLeaf != null)
                OnArchiveLeafSelected(archiveLeaf);
        }
Exemplo n.º 3
0
        private void OnSelectedLeafChanged(IUiLeaf leaf)
        {
            HideControls();

            UiWpdTableLeaf wpdLeaf = leaf as UiWpdTableLeaf;

            if (wpdLeaf != null)
            {
                OnWpdLeafSelected(wpdLeaf);
                return;
            }

            UiArchiveLeaf archiveLeaf = leaf as UiArchiveLeaf;

            if (archiveLeaf != null)
            {
                OnArchiveLeafSelected(archiveLeaf);
            }
        }