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(); }
public DownloadList() { InitializeComponent(); lvwDownloads.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(lvwDownloads, true, null); lvwSegments.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(lvwSegments, true, null); 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(); }
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); DownloadManager.Instance.OnChange += Instance_Change; //for (int i = 0; i < DownloadManager.Instance.Downloads.Count; i++) //{ // AddDownload(DownloadManager.Instance.Downloads[i]); //} foreach (Downloader download in DownloadManager.Instance.OrderedDownloads) { AddDownload(download); } lvwDownloads.SmallImageList = FileTypeImageList.GetSharedInstance(); }