/// <summary> /// 导出目录下的所有脚本 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void cmdTreePhFolder_export_Click(object sender, EventArgs e) { TreeNode tn_folder = treePh.SelectedNode; if (tn_folder != null) { List<string> scriptIDList = new List<string>(); fillArrayListInIDFromNode(scriptIDList, tn_folder); exportForm = new ExportForm(scriptIDList, Helper.ClientPath); exportForm.ShowDialog(); } }
/// <summary> /// 保存当前脚本 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void btnSave_Click(object sender, EventArgs e) { EditForm editForm = this.ActiveMdiChild as EditForm; string strOut = ScriptCheck(); if (strOut != null) { strOut = strOut.TrimEnd('\n'); } if (!string.IsNullOrEmpty(strOut)) // 脚本检查有问题 { if (MessageBox.Show(string.Format("{0} 脚本中包含错误:\r\n{1}\r\n\r\n确认保存吗?", editForm.FileName, strOut), "脚本检查", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { editForm.DoSave(); TreePhOpera.SetNodeColorByID(treePh, editForm.ID, Color.Red); } } else { TreePhOpera.SetNodeColorByID(treePh, editForm.ID, Color.Black); bool bret = editForm.DoSave(); if (bret) { // 保存后自动导出 if (editForm.ID != "0") { List<string> scriptIDList = new List<string>(); scriptIDList.Add(editForm.ID); exportForm = new ExportForm(scriptIDList, Helper.ClientPath); exportForm.ShowDialog(); } } } }
/// <summary> /// 导出文件 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void cmdTreePhFile_export_Click(object sender, EventArgs e) { TreeNode currentNode = treePh.SelectedNode; if (currentNode != null) { Hashtable infoTable = currentNode.Tag as Hashtable; string id = infoTable["id"].ToString(); List<string> scriptIDList = new List<string>(); scriptIDList.Add(id); exportForm = new ExportForm(scriptIDList, Helper.ClientPath); exportForm.ShowDialog(); } }