protected void DeleteSkylineDocNodes(Control owner, ICollection <SkylineDocNode> docNodes) { if (docNodes.Count == 0) { return; } var confirmationMessages = docNodes.Select(node => node.GetDeleteConfirmation(docNodes.Count)).Distinct() .ToArray(); string message = confirmationMessages.Length == 1 ? confirmationMessages[0] : SkylineDocNode.GetGenericDeleteConfirmation(docNodes.Count); if (MultiButtonMsgDlg.Show(owner, message, MultiButtonMsgDlg.BUTTON_OK) != DialogResult.OK) { return; } DeleteDocNodes(new HashSet <IdentityPath>(docNodes.Select(node => node.IdentityPath))); }
public static void DeleteSkylineDocNodes(SkylineWindow skylineWindow, BoundDataGridView dataGridView, IEnumerable <SkylineDocNode> docNodesToDelete) { var docNodes = (ICollection <SkylineDocNode>)DistinctNodes(docNodesToDelete).ToList(); if (docNodes.Count == 0) { return; } var owner = FormUtil.FindTopLevelOwner(dataGridView); var confirmationMessages = docNodes.Select(node => node.GetDeleteConfirmation(docNodes.Count)).Distinct() .ToArray(); string message = confirmationMessages.Length == 1 ? confirmationMessages[0] : SkylineDocNode.GetGenericDeleteConfirmation(docNodes.Count); if (MultiButtonMsgDlg.Show(owner, message, MultiButtonMsgDlg.BUTTON_OK) != DialogResult.OK) { return; } DeleteDocNodes(skylineWindow, new HashSet <IdentityPath>(docNodes.Select(node => node.IdentityPath))); }