void LoadFiles(string DirPath) { long SizeOfFiles = 0; try { ico.AddFolderIcon(DirPath); fileSystemWatcher1.EnableRaisingEvents = false; fileSystemWatcher1.Path = DirPath; string[] fPathes = Directory.GetFiles(DirPath); foreach (string fPath in fPathes) { SizeOfFiles += AddItemToListView(fPath, true); } } catch { } finally { toolStripStatusLabel2.Text = String.Format(new FileSizeFormatProvider(), "File size: {0:fs}", SizeOfFiles); toolStripStatusLabel1.Text = listView1.Items.Count + " Objects."; fileSystemWatcher1.EnableRaisingEvents = true; } }
void solutionTreeView_AfterExpand(object sender, TreeViewEventArgs e) { e.Node.ImageIndex = _iconListManager.AddFolderIcon(FolderType.Open); }