private void PopulateChildNodes(bool recursive, Project project) { dirty = false; // nuke the placeholder if (Nodes.Count == 1 && Nodes[0] is PlaceholderNode) { Nodes.RemoveAt(0); } // do a nice stateful update against the filesystem GenericNodeList nodesToDie = new GenericNodeList(); // don't remove project output node if it exists - it's annoying when it // disappears during a build foreach (GenericNode node in Nodes) { if (node is ProjectOutputNode) { var output = node as ProjectOutputNode; if (!project.IsPathHidden(output.BackingPath)) { output.Refresh(recursive); } else { nodesToDie.Add(output); } } else if (node is ReferencesNode) { node.Refresh(recursive); } else { nodesToDie.Add(node); } // add any mapped nodes if (node is FileNode && !(node is SwfFileNode)) { nodesToDie.AddRange(node.Nodes); } } if (Directory.Exists(BackingPath)) { PopulateDirectories(nodesToDie, recursive, project); PopulateFiles(nodesToDie, recursive, project); } foreach (GenericNode node in nodesToDie) { node.Dispose(); Nodes.Remove(node); } }
private void PopulateChildNodes(bool recursive) { dirty = false; // nuke the placeholder if (Nodes.Count == 1 && Nodes[0] is PlaceholderNode) { Nodes.RemoveAt(0); } // do a nice stateful update against the filesystem GenericNodeList nodesToDie = new GenericNodeList(); // don't remove project output node if it exists - it's annoying when it // disappears during a build foreach (GenericNode node in Nodes) { nodesToDie.Add(node); // add any mapped nodes if (node is FileNode) { nodesToDie.AddRange(node.Nodes); } } if (Directory.Exists(BackingPath)) { PopulateDirectories(nodesToDie, recursive); PopulateFiles(nodesToDie, recursive); } foreach (GenericNode node in nodesToDie) { node.Dispose(); Nodes.Remove(node); } }