/// <summary> /// Open the window for lone validation. /// </summary> /// <param name="result">The quantification result.</param> internal void OpenLoneValidationWindow(QuantResult result) { // Check if an form already is open if (Application.OpenForms.OfType <QuantificationLone>().Count() == 1) { // If form is already open, update the validation form. quantificationLoneUI.UpdateWindow(result); } else { // If a form is not already open, create a new one quantificationLoneUI = new QuantificationLone(result); // And show. quantificationLoneUI.Show(); } }
private void MetroGridQuantification_SelectionChanged(object sender, EventArgs e) { // Check that the validation is enabled if (metroToggleValEnabled.Checked) { if (metroGridQuantification.SelectedRows.Count > 0) { int spectrumID = Convert.ToInt32(metroGridQuantification.SelectedRows[0].Cells[8].Value); QuantResult selectedResult = Quantification.QuantificationResults.Where(res => res.CitSpectrumID == spectrumID).FirstOrDefault(); // Check validation type if (selectedResult.ValidationBy == "Lone") { OpenLoneValidationWindow(selectedResult); } else { OpenPairedValidationWindow(selectedResult); } } } }