private void DiskReader_DiskReadComplete(DiskReader reader, long Elapsed, ListViewItem item) { Invoke(new SetTextDelegate(SetSize), new object[] { StrFormatByteSize(reader.Size), item }); Invoke(new SetTextDelegate(SetBytes), new object[] { reader.Size.ToString("#,##0"), item }); Invoke(new SetTextDelegate(SetFiles), new object[] { reader.Files.ToString("#,##0"), item }); Invoke(new SetTextDelegate(SetFolders), new object[] { reader.Folders.ToString("#,##0"), item }); }
private void DiskReader_DiskReadComplete(DiskReader reader, long Elapsed, ListViewItem item) { RePlot(reader); //treemap = new TreeMapItem(); //treemap.Plot(diskReader, new System.Drawing.RectangleF(0, 0, Width, Height)); //using (Bitmap copy = new Bitmap(Width, Height)) //{ // using (Graphics clientDC = Graphics.FromImage(Image)) // { // using (Graphics offScreenDC = Graphics.FromImage(copy)) // { // ReDraw(offScreenDC); // clientDC.DrawImage(copy, 0, 0); // this.Invoke(new UpdateScreenCallback(Refresh), null); // } // } //} }
public void Load(TreeNode parent) { this.TreeNode = parent; if (!Visible) { return; } currentObject = null; disk = null; treemap = null; if (root != null) { root.Dispose(); } root = null; if (diskReader != null) { diskReader.Cancel = true; } diskReader = null; if (copy != null) { copy.Dispose(); } copy = null; root = (PIDL)((PIDL)parent.Tag).Clone(); if (root.PhysicalPath.Length > 0) { using (Graphics g = Graphics.FromImage(Image)) { g.Clear(Color.White); WriteCaption(g, "Loading " + " " + root.DisplayName, new Rectangle(0, 0, this.Width, this.Height), Color.Black, true, 30f); this.Invoke(new UpdateScreenCallback(this.Refresh), null); } diskReader = new DiskReader(root.PhysicalPath, null); diskReader.DiskReadComplete += DiskReader_DiskReadComplete; diskReader.Progress += DiskReader_Progress; } }