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); } } } }
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); }
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); } }