コード例 #1
0
        private void BrowseRN_Click(object sender, EventArgs e)
        {
            EQ.Checked  = true;
            Cid.Enabled = true;

            string prompt = "Enter the " + Qc.ActiveLabel + " to be retrieved";
            string title  = "Limit " + Qc.ActiveLabel;
            string tok    = InputCompoundId.Show(prompt, title, Cid.Text, Qc.MetaColumn.MetaTable);

            if (tok != null)
            {
                Cid.Text = tok;
            }
            return;
        }
コード例 #2
0
        /// <summary>
        /// Retrieve an existing molecule and store in MoleculeControl
        /// </summary>
        /// <param name="molCtl"></param>
        /// <param name="mc"></param>

        public static void RetrieveDatabaseStructure(
            MoleculeControl molCtl,
            MetaColumn mc)
        {
            MetaTable mt = null;
            string    cid = "", txt;

            txt = "compound id";
            if (mc != null)
            {
                mt   = mc.MetaTable;
                txt += " (" + mt.KeyMetaColumn.Label + ", etc.)";
            }

            txt = "Enter the " + txt + " that you want to use as a model.";

            while (true)
            {
                cid = InputCompoundId.Show(txt, "Retrieve Molecule from Database", cid, mt);
                if (String.IsNullOrEmpty(cid))
                {
                    return;
                }

                string molString = InputCompoundId.Molecule.PrimaryValue;
                if (String.IsNullOrEmpty(molString))
                {
                    MessageBoxMx.ShowError("Compound number is not in the database, try again.");
                    continue;
                }

                MoleculeMx cs = InputCompoundId.Molecule;

                cs.RemoveStructureCaption();                                      // remove any caption
                molCtl.SetPrimaryTypeAndValue(cs.PrimaryFormat, cs.PrimaryValue); // set mol
                molCtl.SetTemporaryMoleculeTag(cid);                              // associate the cid in case saved as history/favorite
                break;
            }
        }