public FolderInfo(FolderInfo parent, string fullPath, string displayName, uint clusterSizeOverride) { this.parent = parent; this.fullPath = fullPath; this.displayName = displayName; this.clusterSizeOverride = clusterSizeOverride; }
public SizeNode(FolderInfo fi) : this(fi.DisplayName, fi.FullPath, fi.State, fi.Size, ExtendedFileInfo.GetIconForFilename(fi.FullPath, true), fi.FullPath) { this.folderInfo = fi; directories = null; // not loaded yet if (fi.State == ScanState.SCANNING || fi.State == ScanState.DONE) { FillInFiles(); } BuildDummyNode(); }
public void MoveToFront(FolderInfo fi) { lock (this) { if (!queue.Contains(fi)) return; Stack<FolderInfo> tmp = new Stack<FolderInfo>(); while (true) { FolderInfo f = queue.Pop(); if (f == fi) break; tmp.Push(f); } while (tmp.Count > 0) { queue.Push(tmp.Pop()); } queue.Push(fi); } }
public void AddFolder(FolderInfo fi, int gen) { AddFolders(new FolderInfo[] { fi }, gen); }
private void Unlink() { if (folderInfo == null) return; if (state != ScanState.DONE) throw new Exception(); LoadChildren(); folderInfo = null; displayName += "*"; }
public void AddFolder(FolderInfo fi, int gen) { AddFolders(new FolderInfo[] { fi }, gen); }
public void ExpandFolder(FolderInfo fi) { if (InvokeRequired) { try { Invoke(new FolderDelegate(ExpandFolder), fi); } catch (ObjectDisposedException) { } return; } lock (this) { SizeNode sn = nodeMap[fi]; TreeNode n = sn.treeNode; FillInChildren(sn, n); n.Expand(); } }
private void ScanFolder() { filesByExtensionToolStripMenuItem.Checked = false; filesByExtensionToolStripMenuItem.Enabled = true; string directory = folderBrowser.SelectedPath; FolderInfo fi = new FolderInfo(null, directory, directory, 0); fi.State = ScanState.EXPANDQUEUED; SizeNode sn = new SizeNode(fi); nodeMap[fi] = sn; TreeNode tn = BuildTreeNode(sn); tree.Nodes.Add(tn); fqueue.AddFolder(fi, fqueue.Generation); }
public void UpdateFolder99(FolderInfo toUpdate) { // update parents UpdateFolder00(nodeMap[toUpdate].treeNode); toUpdate.StateChanged = false; FolderInfo f = toUpdate.Parent; while (f != null && f.State == ScanState.DONE) { if (nodeMap.ContainsKey(f)) UpdateFolder00(nodeMap[f].treeNode); f = f.Parent; } }
public void UpdateFolder(FolderInfo f) { if (InvokeRequired) { try { Invoke(new FolderDelegate(UpdateFolder), f); } catch (ObjectDisposedException) { } return; } while (f != null && !nodeMap.ContainsKey(f)) f = f.Parent; if (f != null && f.StateChanged) UpdateFolder99(f); }