Example #1
0
/// <summary>
/// Validate list of cids
/// </summary>
/// <returns></returns>

        bool ValidateList()
        {
            if (!ValidateNumbers.Checked || RootTable == null)
            {
                return(true);
            }

            DisplayStatusMsg("Validating numbers...");
            string invalidCid = CompoundIdUtil.ValidateList(CidListCtl.Text, RootTable.Name);

            if (!String.IsNullOrEmpty(invalidCid))
            {
                int i2 = Lex.IndexOf(CidListCtl.Text, invalidCid);                 // original position
                if (i2 >= 0)
                {
                    CidListCtl.Select(i2, invalidCid.Length);                     // select bad compound id
                    CidListCtl.Focus();
                }

                string errorMsg = invalidCid + " is an invalid " + RootTable.KeyMetaColumn.Label;
                DisplayStatusMsg(errorMsg);                 // put up error message
                SystemUtil.Beep();
                return(false);
            }

            DisplayStatusMsg("");
            return(true);
        }
Example #2
0
        private void GroupSalts_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DisplayStatusMsg("Grouping Salts, wait please...");
            GetNormalizedListFromControl(CidList);
            List <string> al      = MoleculeUtil.GroupSalts(CidList.ToStringList());
            CidList       newList = new CidList(al);

            newList.UserObject = CidList.UserObject;
            CidList            = newList;
            string formattedList = FormatList();

            CidListCtl.Text = formattedList;     // put text in editor
            CidListCtl.Select(0, 0);             // position cursor at beginning of list
            DisplayStatusMsg("");
            return;
        }