private void OK_Click(object sender, EventArgs e) { Psc.Molecule = QueryMolCtl.Molecule.Clone(); Psc.Molecule.RemoveStructureCaption(); // remove any structure caption that may cause a problem try { if (None.Checked || Lex.IsNullOrEmpty(Psc.Molecule.PrimaryValue)) // say none if checked or no structure { Psc.SearchType = StructureSearchType.Unknown; } else if (SubStruct.Checked) { SSOptions.GetValues(Psc); } else if (Similarity.Checked) { SimOptions.GetValues(Psc); } else if (Full.Checked) { FSOptions.GetValues(Psc); } else if (SmallWorld.Checked) { SmallWorldOptions.GetValues(Psc); UpdateAssociatedSmallWorldQueryColumns(Psc); } else { throw new Exception("No recognized search type checked"); // shouldn't happen } Psc.ConvertToQueryColumnCriteria(Qc); } catch (Exception ex) { MessageBoxMx.ShowError(ex.Message); return; } MoleculeSelectorControl.AddToMruList(QueryMolCtl, Psc.SearchType); DialogResult = DialogResult.OK; return; }
private void RunQueryButton_Click(object sender, EventArgs e) { if (!ValidateFormAndBuildQuery()) { return; } PreserveRelatedCheckmarkPreferences(); MoleculeSelectorControl.AddToMruList(QueryMolCtl, StructureSearchType.Unknown); Query q = RelatedCompoundsQuery; this.Hide(); bool success = QbUtil.RunPopupQuery(q, q.Name, OutputDest.WinForms, ExitingQueryResultsCallBack); if (!success) { this.Show(); } return; }