Beispiel #1
0
 public void MoveNodeToUnderParent(ITreeItem newParent, ITreeItem nodeToMove)
 {
     if (newParent == null)
     {
         throw new ArgumentNullException(nameof(newParent));
     }
     if (newParent.IsDescendantOf(nodeToMove))
     {
         return;
     }
     nodeToMove.Parent.RemoveChild(nodeToMove);
     newParent.AddChild(nodeToMove);
 }
Beispiel #2
0
        private void CreateSubFolders(ITreeItem parent)
        {
            ActionResult <IEnumerable <DirectoryInfo> > actionResult =
                DirectoryCrawler.GetSubFolders(parent.Path, false);

            if (actionResult.Successful)
            {
                foreach (DirectoryInfo di in actionResult.Result)
                {
                    FolderTreeItemViewModel sub = new FolderTreeItemViewModel(di);
                    AddToTree(sub);
                    nodeDict.Add(sub.Path.ToLower(), sub);
                    sub.Expanded  += OnVmExpanded;
                    sub.Collapsed += OnVmCollapsed;
                    parent.AddChild(sub);
                }
            }
            //else
            //{
            //    logger.Log(LogMessageStatus.Warning, actionResult.GetComments());
            //}
        }