Exemplo n.º 1
0
        /// <summary>
        /// Click function to open an external web site when clicking on a CID in a SmallWorld database display
        /// </summary>
        /// <param name="args"></param>

        public static void OpenUrlFromSmallWorldCid(
            string cid)
        {
            string[] px = { "PBCHM", "PDB" };

            RootTable rt = CompoundId.GetRootTableFromCid(cid);

            if (rt == null || Lex.IsUndefined(rt.CidUrl))
            {
                if (rt != null && Lex.Contains(rt.MetaTableName, MetaTable.PrimaryRootTable))
                {
                    RelatedCompoundsDialog.Show(cid);
                    return;
                }

                MessageBoxMx.ShowError("Unable to determine url link for compound Id: " + cid);
                return;
            }

            string url = rt.CidUrl;

            foreach (string p in px)             // remove unwanted URLs
            {
                if (Lex.StartsWith(cid, p))
                {
                    cid = cid.Substring(p.Length);
                }
            }

            url = Lex.Replace(url, "[CID]", cid);
            SystemUtil.StartProcess(url);
            return;
        }
Exemplo n.º 2
0
        private void RelatedDataButton_Click(object sender, EventArgs e)
        {
            if (!Lex.IsDefined(Cid))
            {
                return;
            }

            HideQuickSearchPopup();
            PreviousInput = "";             // avoid any additional QuickDisplays

            RelatedCompoundsDialog.Show(Cid);

            return;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Show the form
        /// </summary>
        /// <param name="qm"></param>
        /// <param name="cid"></param>

        public static void Show(
            string cid,
            QueryManager qm = null)
        {
            RelatedCompoundsDialog i = new RelatedCompoundsDialog();

            i.MruListCtl.ImageList = Bitmaps.Bitmaps16x16;

            if (!i.SetupForm(cid, qm))
            {
                return;                                    // just return if some error
            }
            i.Show();

            return;
        }