void m_genDataViewer_TriggerAction(object sender, TriggerActionArgs e) { if (this.m_detailHostObj != null) { if (this._myForm != null && this._myForm.IsDisposed == true) { if (this.m_genDataViewer != null) { this.m_genDataViewer.Clear(); #if NO this.m_genDataViewer.Close(); this.m_genDataViewer = null; #endif CloseGenDataViewer(); return; } } if (String.IsNullOrEmpty(e.EntryName) == false) { this.SynchronizeMarc(); this.m_detailHostObj.Invoke(e.EntryName, e.sender, e.e); // if (this.tabControl_biblioInfo.SelectedTab == this.tabPage_template) TODO: 这里是不是没有必要优化了 this.SynchronizeMarc(); } if (this.m_genDataViewer != null) { this.m_genDataViewer.RefreshState(); } } }
private void ActionTable_DoubleClick(object sender, EventArgs e) { if (this.ActionTable.SelectedRows.Count == 0) { MessageBox.Show(this, "尚未选择事项..."); return; } this.SelectedAction = (ScriptAction)this.ActionTable.SelectedRows[0].Tag; Debug.Assert(this.SelectedAction != null, ""); this.SelectedIndex = this.Actions.IndexOf(this.SelectedAction); if (this.CloseWhenComplete == true) { this.Close(); } if (this.SelectedAction != null && this.TriggerAction != null) { TriggerActionArgs e1 = new TriggerActionArgs(); e1.EntryName = this.SelectedAction.ScriptEntry; e1.sender = this.sender; e1.e = this.e; this.TriggerAction(this, e1); } }
private void ActionTable_KeyDown(object sender, KeyEventArgs e) { Debug.Assert(this.Actions != null, ""); char key = (char)e.KeyValue; if (key == (char)Keys.Enter) { this.ActionTable_DoubleClick(this, null); return; } else if (key == (char)Keys.Escape) { this.Close(); return; } else if (char.IsLetter(key) == true) { foreach (ScriptAction action in this.Actions) { if (Char.ToUpper(key) == Char.ToUpper(action.ShortcutKey)) { this.SelectedIndex = this.Actions.IndexOf(action); this.SelectedAction = action; if (this.CloseWhenComplete == true) { this.Close(); } if (this.SelectedAction != null && this.TriggerAction != null) { TriggerActionArgs e1 = new TriggerActionArgs(); e1.EntryName = this.SelectedAction.ScriptEntry; e1.sender = this.sender; e1.e = this.e; this.TriggerAction(this, e1); } return; } } // Console.Beep(); } }
private void button_excute_Click(object sender, EventArgs e) { if (Actions == null || this.TriggerAction == null) { return; } if (this.ActionTable.SelectedRows.Count == 0) { MessageBox.Show(this, "尚未选择要执行的事项..."); return; } if (this.CloseWhenComplete == true) { this.Close(); } List <DpRow> selections = new List <DpRow>(); selections.AddRange(this.ActionTable.SelectedRows); foreach (DpRow row in selections) { ScriptAction action = (ScriptAction)row.Tag; Debug.Assert(action != null, ""); if (action != null && this.TriggerAction != null) { TriggerActionArgs e1 = new TriggerActionArgs(); e1.EntryName = action.ScriptEntry; e1.sender = this.sender; e1.e = this.e; this.TriggerAction(this, e1); } } }