private static void CollapsedAll(TreeItemBase treeItem) { treeItem.IsExpanded = false; foreach (var treeItemBase in treeItem.Items) { CollapsedAll(treeItemBase); } }
private static void ExpanderAll(TreeItemBase treeItem) { treeItem.IsExpanded = true; foreach (var treeItemBase in treeItem.Items) { ExpanderAll(treeItemBase); } }
public void SaveAll(TreeItemBase parent) { parent.Save(); foreach (var item in parent.Items) { SaveAll(item); } }
private static void UpdatePathWithChildPaths(TreeItemBase treeItemBase) { var parentPath = Path.HasExtension(treeItemBase.Parent.FullPath) ? treeItemBase.Parent.DirPath : treeItemBase.Parent.FullPath; treeItemBase.DirPath = parentPath; foreach (var treeItem in treeItemBase.Items) { UpdatePathWithChildPaths(treeItem); } }
public void MoveTo(TreeItemBase target) { var hasEx = Path.HasExtension(target.FullPath); var targetDirPath = hasEx ? target.DirPath : target.FullPath; var result = MoveTo(targetDirPath); if (result) { Parent.Items.Remove(this); target.Items.Add(this); Parent = target; UpdatePathWithChildPaths(this); Parent.IsExpanded = true; } }
public TreeItemBase(TreeItemBase parent, string fileName, string location) { Parent = parent; HeaderName = fileName; DirPath = location; InitTabItemCloseCommand(); InitTabItemTitleMouseDownCommand(); InitOpenExplorerCommand(); InitNewControllerCommand(); InitNewFolderCommand(); InitDeleteForMenuCommand(); InitDeleteForShortcutCommand(); InitRenameCommand(); InitRenameTextChanged(); InitExpanderAllCommand(); InitCollapsedAllCommand(); InitRunCommand(); }