private void DisplayZIPOnTree(ZipRemoteFile zipFile) { checkableTreeView1.ImageList = FileTypeImageList.GetSharedInstance(); checkableTreeView1.Nodes.Clear(); foreach (ZipEntry entry in zipFile) { // skip folders... if (entry.Name.EndsWith("/")) { continue; } string displayName; TreeNode parentNd = GetNodeFromPath(entry.Name, out displayName); TreeNode newNd = new TreeNode(displayName); newNd.Tag = entry; newNd.ImageIndex = FileTypeImageList.GetImageIndexByExtention(Path.GetExtension(entry.Name)); newNd.SelectedImageIndex = newNd.ImageIndex; if (parentNd == null) { checkableTreeView1.Nodes.Add(newNd); } else { parentNd.Nodes.Add(newNd); } } }
public DownloadList() { InitializeComponent(); DownloadManager.Instance.DownloadAdded += new EventHandler <DownloaderEventArgs>(Instance_DownloadAdded); DownloadManager.Instance.DownloadRemoved += new EventHandler <DownloaderEventArgs>(Instance_DownloadRemoved); DownloadManager.Instance.DownloadEnded += new EventHandler <DownloaderEventArgs>(Instance_DownloadEnded); for (int i = 0; i < DownloadManager.Instance.Downloads.Count; i++) { AddDownload(DownloadManager.Instance.Downloads[i]); } lvwDownloads.SmallImageList = FileTypeImageList.GetSharedInstance(); }