private void DeleteDriveButton_Click(object sender, EventArgs e) { List<VBDRow> rows = SelectedVBDRows; if (rows == null) return; List<SelectedItem> l = new List<SelectedItem>(); foreach (VBDRow r in rows) l.Add(new SelectedItem(r.VDI)); DeleteVirtualDiskCommand cmd = new DeleteVirtualDiskCommand(Program.MainWindow, l); // User has visibility that this disk in use by this VM. Allow unplug + delete in single step (non default behaviour), // but only if we are the only VBD (default behaviour) cmd.AllowRunningVMDelete = true; if (cmd.CanExecute()) cmd.Execute(); }
private void removeVirtualDisk_Click(object sender, EventArgs e) { SelectedItemCollection vdis = SelectedVDIs; DeleteVirtualDiskCommand cmd = new DeleteVirtualDiskCommand(Program.MainWindow, vdis); cmd.AllowMultipleVBDDelete = true; if (cmd.CanExecute()) cmd.Execute(); }
private void RemoveSelectedVdis() { SelectedItemCollection vdis = SelectedVDIs; DeleteVirtualDiskCommand cmd = new DeleteVirtualDiskCommand(Program.MainWindow, vdis) {AllowMultipleVBDDelete = true}; if (cmd.CanExecute()) cmd.Execute(); }