Esempio n. 1
0
 internal void OnTreeNodeDelete(FileTreeNode node)
 {
     ElementDeleted?.Invoke(node, new SFMEventArgs()
     {
         element = node.Value
     });
 }
Esempio n. 2
0
 public void SetRenamingNode(FileTreeNode nwRenamingNode)
 {
     if (CurrentRenamingNode != null)
     {
         CurrentRenamingNode.NotRenaming = true;
     }
     if (nwRenamingNode != null)
     {
         CurrentRenamingNode             = nwRenamingNode;
         CurrentRenamingNode.NotRenaming = false;
     }
 }
Esempio n. 3
0
        private void AddChildToNode(IFileSystemElement element)
        {
            FileTreeNode nwNode = new FileTreeNode(Tree, this, element);

            if (nwNode.IsDirectory)
            {
                ChildDirectoryNodes?.Add(nwNode);
            }
            else
            {
                ChildFileNodes?.Add(nwNode);
            }
        }
Esempio n. 4
0
        private bool RemoveChildFromNode(IFileSystemElement element)
        {
            ObservableCollection <FileTreeNode> targetCollection;
            FileTreeNode targetNode = FindNodeInCollection(out targetCollection, element);

            if (targetNode == null)
            {
                return(false);
            }

            targetCollection.Remove(targetNode);
            targetNode.SetUpdating(false);

            Tree.OnTreeNodeDelete(targetNode);
            return(true);
        }
Esempio n. 5
0
        internal FileTreeNode(DynamicFileSystemTree tree, FileTreeNode parent, IFileSystemElement value) : this(tree) {
            this.Value  = value;
            this.IsRoot = (parent == null);
            this.Parent = parent;

            this.OpenedAtLeastOnce = IsRoot;

            this.ChildrenInitialized = !IsDirectory;
            this.IsUpdating          = IsExpanded;

            this.PropertyChanged += SetIsUpdatingToIsExpanding;

            if (IsRoot || (parent != null && parent.OpenedAtLeastOnce && parent.ChildDirectoryNodes.Count < 256))
            {
                LoadChildren();
            }
            else
            {
                parent.PropertyChanged += OnPropertyChanged;
            }
        }
Esempio n. 6
0
        public bool Contains(FileTreeNode node)
        {
            if (!object.ReferenceEquals(node.Tree, this))
            {
                return(false);
            }

            var curNode = node;

            while (curNode.Parent != null)
            {
                var parentNode = curNode.Parent;
                if (!parentNode.ChildDirectoryNodes.Contains(curNode) && !parentNode.ChildFileNodes.Contains(curNode))
                {
                    return(false);
                }
                curNode = parentNode;
            }

            return(object.ReferenceEquals(curNode, Root));
        }
Esempio n. 7
0
        internal FileTreeNode(DynamicFileSystemTree tree, FileTreeNode child) : this(tree) {
            ChildDirectoryNodes = new ObservableCollection <FileTreeNode>();
            ChildFileNodes      = new ObservableCollection <FileTreeNode>();

            ChildDirectoryNodes.Add(child);
        }
Esempio n. 8
0
 internal void OnTreeNodeDelete(FileTreeNode node)
 {
     FileSystemFacade.Instance.OnTreeNodeDelete(node);
 }
Esempio n. 9
0
 public static void LoadNodesChildren(FileTreeNode targetNode)
 {
     targetNode.LoadChildren();
 }
Esempio n. 10
0
 internal DynamicFileSystemTree(SFMDirectory root)
 {
     Root = new FileTreeNode(this, null, root);
 }
Esempio n. 11
0
 public void SetRenamingNode(FileTreeNode node)
 {
     CurrentRenamingNode?.Tree.SetRenamingNode(null);
     node?.Tree.SetRenamingNode(node);
     CurrentRenamingNode = node;
 }