Ejemplo n.º 1
0
        private void PopulateFiles(GenericNodeList nodesToDie, bool recursive)
        {
            string[] files = Directory.GetFiles(BackingPath);

            foreach (string file in files)
            {
                if (IsFileExcluded(file))
                {
                    continue;
                }

                if (Tree.NodeMap.ContainsKey(file))
                {
                    GenericNode node = Tree.NodeMap[file];
                    node.Refresh(recursive);
                    nodesToDie.Remove(node);
                }
                else
                {
                    FileNode node = FileNode.Create(file, project);
                    InsertNode(Nodes, node);
                    node.Refresh(recursive);
                    nodesToDie.Remove(node);
                }
            }

            FileMapping mapping = GetFileMapping(files);

            if (mapping == null)
            {
                return;
            }

            foreach (string file in files)
            {
                if (IsFileExcluded(file))
                {
                    continue;
                }

                GenericNode node = Tree.NodeMap[file];

                // ensure this file is in the right spot
                if (mapping != null && mapping.ContainsKey(file) && Tree.NodeMap.ContainsKey(mapping[file]))
                {
                    EnsureParentedBy(node, Tree.NodeMap[mapping[file]]);
                }
                else
                {
                    EnsureParentedBy(node, this);
                }
            }
        }
Ejemplo n.º 2
0
        public void RefreshNode(GenericNode node)
        {
            // refresh the first parent that *can* be refreshed
            while (node != null && !node.IsRefreshable)
            {
                node = node.Parent as GenericNode;
            }
            if (node == null)
            {
                return;
            }

            node.Refresh(true);
        }
        public void RefreshNode(GenericNode node)
        {
            // refresh the first parent that *can* be refreshed
            while (node != null && !node.IsRefreshable)
            {
                node = node.Parent as GenericNode;
            }
            if (node == null)
            {
                return;
            }
            // if you refresh a SwfFileNode this way (by asking for it), you get
            // special feedback
            SwfFileNode swfNode = node as SwfFileNode;

            if (swfNode != null)
            {
                swfNode.RefreshWithFeedback(true);
            }
            else
            {
                node.Refresh(true);
            }
        }