private void DelayedEditMolecule(object arg) { try { int ci = (int)arg; string txt = Criteria.Text.Substring(ci + 16); // pick up structure name int i1 = txt.IndexOf("]"); if (i1 < 0) { return; } string sid = txt.Substring(0, i1).Trim().ToUpper(); string chime = ""; if (LabeledCriteria.Structures.ContainsKey(sid)) { chime = LabeledCriteria.Structures[sid]; } MoleculeMx mol = new MoleculeMx(MoleculeFormat.Chime, chime); MoleculeMx mol2 = MoleculeEditor.Edit(mol, MoleculeRendererType.Unknown, "Edit Structure"); if (mol2 == null) { return; } if (mol2.IsChemStructureFormat) // store chime for chem structure { mol2.ConvertTo(MoleculeFormat.Chime); } LabeledCriteria.Structures[sid] = mol2.GetPrimaryTypeAndValueString(); return; } catch (Exception ex) { return; } }