private void scriptTree1_SelectedScriptNode(object sender, treeEventArgs e) { //MessageBox.Show(e.scriptPath); frmScriptEdit fseshow = null; foreach (frmScriptEdit fse in this.MdiChildren) { if (e.scriptPath == fse.Tag.ToString()) { fseshow = fse; break; } } if (fseshow == null) { fseshow = new frmScriptEdit(); fseshow.Tag = e.scriptPath; fseshow.Text = e.scriptPath; fseshow.fieldid = e.fieldid; fseshow.tabid = e.tabid; fseshow.strCode = e.scriptCode; fseshow.tag = e.tag; fseshow.MdiParent = this; fseshow.OnSave += new OnSaveEventsHandle(fseshow_OnSave); if (this.OnNewWindow != null) { this.OnNewWindow(this, new svEventsArgs(fseshow.luaEditorControl1)); } fseshow.WindowState = FormWindowState.Maximized; fseshow.Show(); } //激活窗口到前台 foreach (DevComponents.DotNetBar.TabItem ti in this.tabStrip1.Tabs) { if (ti.AttachedControl == fseshow) { tabStrip1.SelectedTab = ti; } } fseshow.GoToPosition(curPosition); curPosition = null; if (mScriptFont != null) { fseshow.luaEditorControl1.ScriptFont = mScriptFont; } }
private void raiseEvent(TreeNode tn, object tag) { treeEventArgs tea = new treeEventArgs(); tagPlus tp = tn.Tag as tagPlus; string strCode = ""; if (tp.nDeep >= 2) { //模块级代码 string sql = "select * from sys_scriptstore where fieldid=" + tp.fieldid + " and modtabid=" + tp.tabid; DataTable dt = sqlDB.ExeSqlDs(sql, "script").Tables[0]; if (dt.Rows.Count > 1) { MessageBox.Show("脚本不唯一!请检查数据库"); return; } if (dt.Rows.Count == 0) { strCode = ""; } else { Byte[] ab = dt.Rows[0]["scriptcode"] as Byte[]; if (ab != null) { strCode = Encoding.UTF8.GetString(ab); } } } else { return; } tea.scriptCode = strCode; tea.scriptPath = tp.stag; tea.fieldid = tp.fieldid; tea.tabid = tp.tabid; tea.tag = tag; if (SelectedScriptNode != null) { SelectedScriptNode(this, tea); } }
private void raiseEvent(TreeNode tn, object tag) { treeEventArgs tea = new treeEventArgs(); tagPlus tp = tn.Tag as tagPlus; string strCode = ""; if (tp.nDeep >= 2) { //模块级代码 string sql = "select * from sys_scriptstore where fieldid=" + tp.fieldid + " and modtabid=" + tp.tabid; DataTable dt = sqlDB.ExeSqlDs(sql, "script").Tables[0]; if (dt.Rows.Count > 1) { MessageBox.Show("脚本不唯一!请检查数据库"); return; } if (dt.Rows.Count == 0) { strCode = ""; } else { Byte[] ab = dt.Rows[0]["scriptcode"] as Byte[]; if (ab != null) strCode = Encoding.UTF8.GetString(ab); } } else { return; } tea.scriptCode = strCode; tea.scriptPath = tp.stag; tea.fieldid = tp.fieldid; tea.tabid = tp.tabid; tea.tag = tag; if (SelectedScriptNode != null) SelectedScriptNode(this, tea); }