private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { ListViewItem item = GetSelectedItem(downloaderList); if (item == null) { return; } DownloaderDialog bd = (DownloaderDialog)item.Tag; bd.Dispose(); downloaderList.Items.Remove(item); }
private void editToolStripMenuItem1_Click(object sender, EventArgs e) { ListViewItem item = GetSelectedItem(downloaderList); if (item == null) { return; } DownloaderDialog bd = (DownloaderDialog)item.Tag; if (bd.ShowDialog() == DialogResult.OK) { item.Text = bd.Url; } }
private void addToolStripMenuItem1_Click(object sender, EventArgs e) { DownloaderDialog bd = new DownloaderDialog(); if (bd.ShowDialog() == DialogResult.OK) { // Icon ico = Icon.ExtractAssociatedIcon(bd.FileName); ListViewItem item = new ListViewItem(); // binderImageList.Images.Add(bd.FileName, ico); //item.ImageKey = bd.FileName; item.Text = bd.Url; item.Tag = bd; downloaderList.Items.Add(item); } }
private SettingsFile GetSettings() { SettingsFile sf = new SettingsFile(); sf.EncryptFiles = checkBox2.Checked; sf.CompressFiles = checkBox1.Checked; sf.BindFiles = new List <BinderSetting>(); foreach (ListViewItem itm in binderList.Items) { BinderDialog bd = (BinderDialog)itm.Tag; sf.BindFiles.Add(bd.GetSettings()); } sf.DownloadFiles = new List <DownloaderSetting>(); foreach (ListViewItem itm in downloaderList.Items) { DownloaderDialog bd = (DownloaderDialog)itm.Tag; sf.DownloadFiles.Add(bd.GetSettings()); } sf.AssemblyDescription = asmDescriptionText.Text; sf.AssemblyCopyright = asmCopyrightText.Text; sf.AssemblyCompany = asmCompanyText.Text; sf.AssemblyProductName = asmProductNameText.Text; sf.AssemblyVersion = asmVersionText.Text; sf.IconPath = iconText.Text; return(sf); }