Exemplo n.º 1
0
        private void listView_browse_DoubleClick(object sender, EventArgs e)
        {
            // 防止重入
            if (m_bInSearch == true)
            {
                MessageBox.Show(this, "当前窗口正在被一个未结束的长操作使用,无法装载记录。请稍后再试。");
                return;
            }

            if (this.LoadDetail != null)
            {
                int nIndex = -1;
                if (this.listView_browse.SelectedIndices.Count > 0)
                {
                    nIndex = this.listView_browse.SelectedIndices[0];
                }
                else
                {
                    if (this.listView_browse.FocusedItem == null)
                    {
                        MessageBox.Show(this, "尚未选定要装入详细窗的事项");
                        return;
                    }
                    nIndex = this.listView_browse.Items.IndexOf(this.listView_browse.FocusedItem);
                }

                LoadDetailEventArgs e1 = new LoadDetailEventArgs();
                e1.RecordPath = Global.ModifyDtlpRecPath(this.listView_browse.Items[nIndex].Text, "ctlno");
                this.LoadDetail(this, e1);
            }
        }
Exemplo n.º 2
0
        private void listView_browse_DoubleClick(object sender, EventArgs e)
        {
            // 防止重入
            if (m_bInSearch == true)
            {
                MessageBox.Show(this, "当前窗口正在被一个未结束的长操作使用,无法装载记录。请稍后再试。");
                return;
            }

            if (this.LoadDetail != null)
            {
                int nIndex = -1;
                if (this.listView_browse.SelectedIndices.Count > 0)
                    nIndex = this.listView_browse.SelectedIndices[0];
                else
                {
                    if (this.listView_browse.FocusedItem == null)
                    {
                        MessageBox.Show(this, "尚未选定要装入详细窗的事项");
                        return;
                    }
                    nIndex = this.listView_browse.Items.IndexOf(this.listView_browse.FocusedItem);
                }

                LoadDetailEventArgs e1 = new LoadDetailEventArgs();
                e1.RecordPath = Global.ModifyDtlpRecPath(this.listView_browse.Items[nIndex].Text, "ctlno");
                this.LoadDetail(this, e1);
            }
        }
Exemplo n.º 3
0
        void dtlpdupform_LoadDetail(object sender, LoadDetailEventArgs e)
        {
            string strError = "";
            DtlpSearchForm dtlp_searchform = null;

            /*
            // 要看看this合法不合法?
            if (this.IsValid() == false)
            {
                strError = "依存的MarcDetailForm已经销毁";
                MessageBox.Show(ForegroundWindow.Instance, strError);
                return;
            }*/

            if (this.LinkedSearchForm == null
                || this.LinkedSearchForm.IsValid() == false
                || !(this.LinkedSearchForm is DtlpSearchForm))
            {
                dtlp_searchform = this.GetDtlpSearchForm();

                if (dtlp_searchform == null)
                {
                    strError = "没有连接的或者打开的DTLP检索窗,无法进行LoadRecord()";
                    goto ERROR1;
                }
            }
            else
            {
                dtlp_searchform = (DtlpSearchForm)this.LinkedSearchForm;
            }

            MarcDetailForm detail = new MarcDetailForm();

            detail.MdiParent = this.MainForm;   // 这里不能用this.MdiParent。如果this已经关闭,this.MainForm还可以使用
            detail.MainForm = this.MainForm;
            detail.Show();
            int nRet = detail.LoadAmazonRecord(dtlp_searchform,
                e.RecordPath,
                "current",
                true);
            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }