public static string ShowCopyDialog(string[] folders) { CopyDlg dlg = new CopyDlg(); foreach (string folder in folders) { dlg.cbFolder.Items.Add(folder); } if (dlg.cbFolder.Items.Count > 0) { dlg.cbFolder.SelectedIndex = 0; } return((dlg.ShowDialog() == DialogResult.OK) ? dlg.cbFolder.SelectedItem.ToString() : ""); }
private void btnCopy_Click(object sender, System.EventArgs e) { if (!imap41.Active) { return; } if (lvMessages.SelectedItems.Count == 1) { string dest = CopyDlg.ShowCopyDialog(imap41.GetMailBoxes()); if (dest != "") { imap41.CopyMessage(Convert.ToInt32(lvMessages.SelectedItems[0].Text), dest); GetFolderList(); } } }