private void GoToChild(UiNode child) { if (child == null || child.GetChilds().Length < 1) { return; } UiNode current = child.Parent; if (current != null) { current.IsSelected = false; } child.IsExpanded = true; child.IsSelected = true; while (child != null) { child.IsExpanded = true; child = child.Parent; } _listView.SelectedIndex = 0; _listView.FocusSelectedItem(); }
private void SelectNode() { try { string selectedPath = InteractionService.Configuration.Provide().FileCommanderSelectedNodePath; if (selectedPath == null) { return; } string[] names = selectedPath.Split('|'); int index = names.Length - 1; IEnumerable <UiNode> current = _treeNodes; while (index >= 0) { string name = names[index--]; UiNode node = current.FirstOrDefault(n => n.Name == name); if (node == null) { break; } node.IsExpanded = true; if (index == -1) { node.IsSelected = true; } else { current = node.GetChilds(); } } } catch (Exception ex) { Log.Error(ex); } }
private void GoToChild(UiNode child) { if (child == null || child.GetChilds().Length < 1) return; UiNode current = child.Parent; if (current != null) current.IsSelected = false; child.IsExpanded = true; child.IsSelected = true; while (child != null) { child.IsExpanded = true; child = child.Parent; } _listView.SelectedIndex = 0; _listView.FocusSelectedItem(); }
private void Check(UiNode node) { switch (node.Type) { case UiNodeType.Group: case UiNodeType.Directory: case UiNodeType.Archive: { foreach (UiNode child in node.GetChilds()) Check(child); break; } case UiNodeType.FileTable: { if (PathComparer.Instance.Value.Equals(node.Name, @"system.win32.xgr") || node.Name.StartsWith("tutorial")) foreach (UiNode child in node.GetChilds()) Check(child); break; } case UiNodeType.ArchiveLeaf: { UiArchiveLeaf leaf = (UiArchiveLeaf)node; string extension = PathEx.GetMultiDotComparableExtension(leaf.Entry.Name); switch (extension) { case ".ztr": if (leaf.Entry.Name.Contains("_us")) leaf.IsChecked = true; break; } break; } case UiNodeType.FileTableLeaf: { UiWpdTableLeaf leaf = (UiWpdTableLeaf)node; switch (leaf.Entry.Extension) { case "wfl": case "txbh": leaf.IsChecked = true; break; } break; } } }