ScriptStepDialog.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161
  1. using PaintDotNet.Base;
  2. using PaintDotNet.CustomControl;
  3. using PaintDotNet.Data.Param;
  4. using PaintDotNet.DbOpreate.DbBll;
  5. using PaintDotNet.DbOpreate.DbModel;
  6. using PaintDotNet.Param;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Drawing;
  10. using System.Reflection;
  11. using System.Windows.Forms;
  12. namespace PaintDotNet.Instrument
  13. {
  14. /// <summary>
  15. /// 正在执行的脚本
  16. /// </summary>
  17. internal partial class ScriptStepDialog : PdnBaseForm
  18. {
  19. private AppWorkspace appWorkspace;
  20. /// <summary>
  21. /// 左侧树形菜单
  22. /// </summary>
  23. private ToolStripItemCollection collection;
  24. /// <summary>
  25. /// 编辑or新增
  26. /// </summary>
  27. private bool edit = false;
  28. /// <summary>
  29. /// 脚本主表数据
  30. /// </summary>
  31. private mic_script script;
  32. /// <summary>
  33. /// 脚本步骤数据
  34. /// </summary>
  35. private List<mic_script_step> steps = new List<mic_script_step>();
  36. /// <summary>
  37. /// 脚本步骤对应的参数数据
  38. /// </summary>
  39. private Dictionary<mic_script_step, List<Args>> args = new Dictionary<mic_script_step, List<Args>>();
  40. /// <summary>
  41. /// 存储该菜单是否能自动执行
  42. /// </summary>
  43. private Dictionary<int, bool> automaticMenus = new Dictionary<int, bool>();
  44. /// <summary>
  45. /// 循环时候的增量
  46. /// </summary>
  47. int offset = 0;
  48. /// <summary>
  49. /// 初始化标记
  50. /// </summary>
  51. bool init = false;
  52. /// <summary>
  53. /// 当前点击的行
  54. /// </summary>
  55. int cellRowIndex = -1;
  56. /// <summary>
  57. /// 控件list
  58. /// </summary>
  59. List<Control> list = new List<Control>();
  60. public ScriptStepDialog(AppWorkspace appWorkspace, bool edit, mic_script script)
  61. {
  62. this.appWorkspace = appWorkspace;
  63. this.ShowInTaskbar = false;
  64. this.edit = edit;
  65. this.script = script;
  66. InitializeComponent();
  67. InitTreeViewData();
  68. InitDataGridView1UI();
  69. //InitDataGridView2UI();
  70. if (this.edit) {
  71. this.textBox1.Text = this.script != null ? this.script.name : "";
  72. InitDataGridView1Data();
  73. }
  74. }
  75. /// <summary>
  76. /// 设置当前执行到脚本功能的名称
  77. /// </summary>
  78. /// <param name="text"></param>
  79. public void setScriptText(string text, Boolean lastStep)
  80. {
  81. this.label1.Text = text;
  82. if (lastStep)
  83. button7.Text = "操作完成";
  84. else
  85. button7.Text = "下一步";
  86. //this.textBox2.Text = text;
  87. }
  88. /// <summary>
  89. /// 初始化treeview数据
  90. /// </summary>
  91. private void InitTreeViewData()
  92. {
  93. this.collection = this.appWorkspace.ToolBar.MainMenu.Items;
  94. TreeNode anime = new TreeNode("菜单");
  95. this.RecursiveData(collection, anime, true);
  96. anime.Expand();
  97. this.treeView1.Nodes.Add(anime);
  98. }
  99. /// <summary>
  100. /// 递归进行数据组织
  101. /// </summary>
  102. private void RecursiveData(ToolStripItemCollection collection, TreeNode anime, bool AutomaticScript)
  103. {
  104. for (int i = 0; i < collection.Count; i++)
  105. {
  106. //排除分隔线
  107. if (collection[i].GetType() != typeof(ToolStripSeparator))
  108. {
  109. if (!collection[i].Name.Equals("OpenRecent") && !collection[i].Name.Equals("CameraSelection"))
  110. {
  111. //如果允许在脚本内使用
  112. if (((PdnMenuItem)collection[i]).CanUseInScript)
  113. {
  114. TreeNode node = new TreeNode();
  115. node.Text = collection[i].Text;
  116. node.Tag = ((PdnMenuItem)collection[i]).MenuId;
  117. if (!automaticMenus.ContainsKey(((PdnMenuItem)collection[i]).MenuId))
  118. automaticMenus.Add(((PdnMenuItem)collection[i]).MenuId, AutomaticScript && ((PdnMenuItem)collection[i]).AutomaticScript);
  119. anime.Nodes.Add(node);
  120. RecursiveData(((PdnMenuItem)collection[i]).DropDownItems, node, AutomaticScript && ((PdnMenuItem)collection[i]).AutomaticScript);
  121. }
  122. }
  123. }
  124. }
  125. }
  126. /// <summary>
  127. /// treeview的节点点击事件
  128. /// </summary>
  129. /// <param name="sender"></param>
  130. /// <param name="e"></param>
  131. private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
  132. {
  133. if (e.Node.Nodes.Count > 0)
  134. {
  135. this.button1.Enabled = false;
  136. }
  137. else
  138. {
  139. this.button1.Enabled = false;
  140. if (!e.Node.Text.Trim().Equals(""))
  141. {
  142. this.button1.Enabled = true;
  143. }
  144. }
  145. }
  146. /// <summary>
  147. /// 初始化脚本内容的DataGridView的表头
  148. /// </summary>
  149. private void InitDataGridView1UI()
  150. {
  151. DataGridViewTextBoxColumn h1 = new DataGridViewTextBoxColumn();
  152. h1.Width = 386;
  153. h1.HeaderText = "功能名称";
  154. DataGridViewComboBoxColumn h2 = new DataGridViewComboBoxColumn();
  155. h2.Width = 104;
  156. h2.HeaderText = "交互方式";
  157. this.dataGridView1.Columns.Add(h1);
  158. this.dataGridView1.Columns.Add(h2);
  159. this.dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  160. this.dataGridView1.Columns[0].ReadOnly = true;
  161. this.dataGridView1.AllowUserToResizeRows = false;
  162. this.dataGridView1.AllowUserToResizeColumns = false;
  163. }
  164. /// <summary>
  165. /// 初始化参数内容的DataGridView的表头
  166. /// 第二列的可选有文本、下拉、范围滑动条
  167. /// 怎么做成动态的?
  168. /// </summary>
  169. private void InitDataGridView2UI()
  170. {
  171. /**
  172. DataGridViewTextBoxColumn h1 = new DataGridViewTextBoxColumn();
  173. h1.Width = 96;
  174. h1.HeaderText = "参数名称";
  175. DataGridViewComboBoxColumn h2 = new DataGridViewComboBoxColumn();
  176. h2.Width = 96;
  177. h2.HeaderText = "参数值";
  178. this.dataGridView2.Columns.Add(h1);
  179. this.dataGridView2.Columns.Add(h2);
  180. this.dataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  181. this.dataGridView2.Columns[0].ReadOnly = true;
  182. this.dataGridView2.AllowUserToResizeRows = false;
  183. this.dataGridView2.AllowUserToResizeColumns = false;
  184. **/
  185. }
  186. /// <summary>
  187. /// 编辑时,读取脚本步骤
  188. /// </summary>
  189. private void InitDataGridView1Data()
  190. {
  191. steps = mic_script_step_BLL.FindAllByScripId(script.id);
  192. List<mic_script_step_param> paramss = mic_script_step_param_BLL.FindAllByScriptId(script.id);
  193. foreach (var step in steps)
  194. {
  195. DataGridViewRow row = new DataGridViewRow();
  196. row.Cells.Add(CreateTextBoxCell(step.step_name, step.menu_id));
  197. row.Cells.Add(CreateComboBoxCell(step.automatic, automaticMenus[step.menu_id]));
  198. this.dataGridView1.Rows.Add(row);
  199. //在这里反射出对应功能的参数类,用于dataGridView2和存储
  200. string className = InvariantData.path_Action + ".Action" + step.menu_id;
  201. ParamObject param = (ParamObject)Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  202. if (param != null && param.Lists!=null)
  203. {
  204. foreach (Args arg in param.Lists)
  205. {
  206. mic_script_step_param param1 = paramss.Find(m => m.param_key.Equals(arg.Key) && m.step_id == step.id);
  207. arg.Value = param1.value != null ? param1.value : param1.param_value;
  208. }
  209. }
  210. args.Add(step, param != null ? param.Lists : null);
  211. }
  212. /**
  213. if (this.dataGridView1.Rows.Count > 0)
  214. {
  215. //高亮
  216. this.dataGridView1.Rows[0].Selected = true;
  217. //设置CurrentRow
  218. this.dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0];
  219. CreateGridView2Row();
  220. }**/
  221. }
  222. /// <summary>
  223. /// 添加按钮
  224. /// </summary>
  225. /// <param name="sender"></param>
  226. /// <param name="e"></param>
  227. private void button1_Click(object sender, EventArgs e)
  228. {
  229. if (this.treeView1.SelectedNode != null)
  230. {
  231. DataGridViewRow row = new DataGridViewRow();
  232. row.Cells.Add(CreateTextBoxCell(this.treeView1.SelectedNode.Text, this.treeView1.SelectedNode.Tag));
  233. row.Cells.Add(CreateComboBoxCell(automaticMenus[(int)this.treeView1.SelectedNode.Tag] ? 1 : 2, automaticMenus[(int)this.treeView1.SelectedNode.Tag]));
  234. this.dataGridView1.Rows.Add(row);
  235. //创建脚本步骤对象
  236. mic_script_step step = new mic_script_step();
  237. step.step_name = this.treeView1.SelectedNode.Text;
  238. step.menu_id = (int)this.treeView1.SelectedNode.Tag;
  239. steps.Add(step);
  240. //在这里反射出对应功能的参数类,用于dataGridView2和存储
  241. string className = InvariantData.path_Action + ".Action" + step.menu_id;
  242. ParamObject param = (ParamObject)Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  243. args.Add(step, param!=null?param.Lists:null);
  244. CreateGridView2Row();
  245. }
  246. }
  247. /// <summary>
  248. /// 移出
  249. /// </summary>
  250. /// <param name="sender"></param>
  251. /// <param name="e"></param>
  252. private void button2_Click(object sender, EventArgs e)
  253. {
  254. if (this.dataGridView1.CurrentRow != null)
  255. {
  256. steps.Remove(steps[this.dataGridView1.CurrentRow.Index]);
  257. this.dataGridView1.Rows.Remove(this.dataGridView1.CurrentRow);
  258. this.flowLayoutPanel1.Controls.Clear();
  259. }
  260. }
  261. /// <summary>
  262. /// 全部移出
  263. /// </summary>
  264. /// <param name="sender"></param>
  265. /// <param name="e"></param>
  266. private void button3_Click(object sender, EventArgs e)
  267. {
  268. this.dataGridView1.Rows.Clear();
  269. this.flowLayoutPanel1.Controls.Clear();
  270. /**使用dataGridView的版本
  271. this.dataGridView2.Rows.Clear();
  272. foreach (Control ct in this.dataGridView2.Controls)
  273. {
  274. dataGridView2.Controls.Clear();
  275. }**/
  276. }
  277. /// <summary>
  278. /// 当前步骤操作完成:操作完成/下一步
  279. /// </summary>
  280. /// <param name="sender"></param>
  281. /// <param name="e"></param>
  282. private void button7_Click(object sender, EventArgs e)
  283. {
  284. if (button7.Text.Equals("操作完成"))
  285. {
  286. this.Close();
  287. }
  288. appWorkspace.ActiveDocumentWorkspace.activeTool = Annotation.Enum.DrawToolType.Pointer;
  289. appWorkspace.ScriptStopping = false;
  290. this.appWorkspace.ResumeScriptRunning();
  291. }
  292. /// <summary>
  293. /// 向上移动
  294. /// </summary>
  295. /// <param name="sender"></param>
  296. /// <param name="e"></param>
  297. private void button4_Click(object sender, EventArgs e)
  298. {
  299. if (this.dataGridView1.CurrentRow != null)
  300. {
  301. int index = this.dataGridView1.CurrentRow.Index;
  302. if (index > 0)
  303. {
  304. DataGridViewRow preRow = (DataGridViewRow)this.dataGridView1.Rows[index - 1];
  305. DataGridViewTextBoxCell textboxcell = (DataGridViewTextBoxCell)preRow.Cells[0];
  306. DataGridViewComboBoxCell comboxcell = (DataGridViewComboBoxCell)preRow.Cells[1];
  307. DataGridViewRow row = new DataGridViewRow();
  308. row.Cells.Add(CreateTextBoxCell(textboxcell.Value.ToString(), textboxcell.Tag));
  309. row.Cells.Add(CreateComboBoxCell((int)comboxcell.Value, automaticMenus[(int)textboxcell.Tag]));
  310. this.dataGridView1.Rows.Insert(index + 1, row);
  311. this.dataGridView1.Rows.RemoveAt(index - 1);
  312. mic_script_step preStep = (mic_script_step)this.steps[index - 1];
  313. //创建脚本步骤对象
  314. mic_script_step step = new mic_script_step();
  315. step.step_name = preStep.step_name;
  316. step.menu_id = preStep.menu_id;
  317. this.steps.Insert(index + 1, step);
  318. args.Remove(preStep);
  319. //在这里反射出对应功能的参数类,用于dataGridView2和存储
  320. string className = InvariantData.path_Action + ".Action" + step.menu_id;
  321. ParamObject param = (ParamObject)Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  322. args.Add(step, param != null ? param.Lists : null);
  323. this.steps.RemoveAt(index - 1);
  324. }
  325. }
  326. }
  327. /// <summary>
  328. /// 向下移动
  329. /// </summary>
  330. /// <param name="sender"></param>
  331. /// <param name="e"></param>
  332. private void button5_Click(object sender, EventArgs e)
  333. {
  334. if (this.dataGridView1.CurrentRow != null)
  335. {
  336. int index = this.dataGridView1.CurrentRow.Index;
  337. if (index < this.dataGridView1.Rows.Count - 1)
  338. {
  339. DataGridViewRow nextRow = (DataGridViewRow)this.dataGridView1.Rows[index + 1];
  340. DataGridViewTextBoxCell textboxcell = (DataGridViewTextBoxCell)nextRow.Cells[0];
  341. DataGridViewComboBoxCell comboxcell = (DataGridViewComboBoxCell)nextRow.Cells[1];
  342. DataGridViewRow row = new DataGridViewRow();
  343. row.Cells.Add(CreateTextBoxCell(textboxcell.Value.ToString(), textboxcell.Tag));
  344. row.Cells.Add(CreateComboBoxCell((int)comboxcell.Value, automaticMenus[(int)textboxcell.Tag]));
  345. this.dataGridView1.Rows.Insert(index, row);
  346. this.dataGridView1.Rows.RemoveAt(index + 2);
  347. mic_script_step nextStep = (mic_script_step)this.steps[index + 1];
  348. //创建脚本步骤对象
  349. mic_script_step step = new mic_script_step();
  350. step.step_name = nextStep.step_name;
  351. step.menu_id = nextStep.menu_id;
  352. this.steps.Insert(index, step);
  353. args.Remove(nextStep);
  354. //在这里反射出对应功能的参数类,用于dataGridView2和存储
  355. string className = InvariantData.path_Action + ".Action" + step.menu_id;
  356. ParamObject param = (ParamObject)Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  357. args.Add(step, param != null ? param.Lists : null);
  358. this.steps.RemoveAt(index + 2);
  359. }
  360. }
  361. }
  362. /// <summary>
  363. /// 创建一个DataGridViewTextBoxCell
  364. /// </summary>
  365. /// <param name="text"></param>
  366. /// <param name="tag"></param>
  367. /// <returns></returns>
  368. private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
  369. {
  370. DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
  371. textboxcell.Value = text;
  372. textboxcell.Tag = tag;
  373. return textboxcell;
  374. }
  375. /// <summary>
  376. /// 创建一个DataGridViewComboBoxCell
  377. /// </summary>
  378. /// <param name="value"></param>
  379. /// <returns></returns>
  380. private DataGridViewComboBoxCell CreateComboBoxCell(int value, bool canAutomatic)
  381. {
  382. DataGridViewComboBoxCell comboxcell = new DataGridViewComboBoxCell();
  383. comboxcell.DataSource = new BindingSource(canAutomatic ? InvariantData.scriptDictionary : InvariantData.scriptManualDictionary, null);
  384. comboxcell.DisplayMember = "Value";
  385. comboxcell.ValueMember = "Key";
  386. comboxcell.Value = canAutomatic ? value : 2;
  387. return comboxcell;
  388. }
  389. /// <summary>
  390. /// 脚本步骤点击事件
  391. /// </summary>
  392. /// <param name="sender"></param>
  393. /// <param name="e"></param>
  394. private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  395. {
  396. if (e.RowIndex>=0)
  397. {
  398. if(cellRowIndex==-1 || (cellRowIndex != -1 && cellRowIndex != e.RowIndex))
  399. {
  400. cellRowIndex = e.RowIndex;
  401. init = false;
  402. CreateGridView2Row();
  403. }
  404. }
  405. }
  406. /// <summary>
  407. /// 创建参数UI及初始化参数值
  408. /// </summary>
  409. private void CreateGridView2Row()
  410. {
  411. mic_script_step step = steps[this.dataGridView1.CurrentRow.Index];
  412. List<Args> arg = args[step];
  413. if (arg != null && arg.Count>0)
  414. {
  415. /**使用dataGridView的版本
  416. this.dataGridView2.Rows.Clear();
  417. foreach (Control ct in this.dataGridView2.Controls)
  418. {
  419. dataGridView2.Controls.Clear();
  420. }**/
  421. this.flowLayoutPanel1.Controls.Clear();
  422. for (int i = 0; i < arg.Count; i++)
  423. {
  424. /**使用dataGridView的版本
  425. DataGridViewRow temp = new DataGridViewRow();
  426. temp.Cells.Add(CreateTextBoxCell(arg[i].Name, arg[i].Key));
  427. temp.Cells.Add(CreateTextBoxCell("", ""));
  428. this.dataGridView2.Rows.Add(temp);
  429. **/
  430. this.CreateParameter(arg[i], i+offset, null);
  431. }
  432. }
  433. else
  434. {
  435. /**使用dataGridView的版本
  436. this.dataGridView2.Rows.Clear();
  437. foreach (Control ct in this.dataGridView2.Controls)
  438. {
  439. dataGridView2.Controls.Clear();
  440. }**/
  441. this.flowLayoutPanel1.Controls.Clear();
  442. }
  443. offset = 0;
  444. init = true;
  445. }
  446. /// <summary>
  447. /// 创建参数的方法
  448. /// </summary>
  449. /// <param name="arg"></param>
  450. /// <param name="i"></param>
  451. private void CreateParameter(Args arg, int i, Args parentArg)
  452. {
  453. if (arg.Type == Dtryt.Decimal)
  454. {
  455. CreateGridView2RowFromDecimalNumber(arg, i, parentArg);
  456. }
  457. else if (arg.Type == Dtryt.Interger)
  458. {
  459. CreateGridView2RowFromIntegerNumber(arg, i, parentArg);
  460. }
  461. else if (arg.Type == Dtryt.Odd)
  462. {
  463. CreateGridView2RowFromOddNumber(arg, i, parentArg);
  464. }
  465. else if (arg.Type == Dtryt.Choise)
  466. {
  467. CreateGridView2RowFromChoiseArray(arg, i, parentArg);
  468. }
  469. else if (arg.Type == Dtryt.Boolean)
  470. {
  471. if (arg.Lists!=null && arg.Lists.Count>0)
  472. {
  473. for (int j = 0; j < arg.Lists.Count; j++)
  474. {
  475. CreateParameter(arg.Lists[j], i + j + offset + 1, parentArg);
  476. if(!init) offset++;
  477. }
  478. }
  479. else
  480. {
  481. CreateGridView2RowFromBooleanObject(arg, i + offset, parentArg);
  482. }
  483. }
  484. else if (arg.Type == Dtryt.DecimalScope)
  485. {
  486. CreateGridView2RowFromDecimalScope(arg, i, parentArg);
  487. }
  488. else if (arg.Type == Dtryt.Color)
  489. {
  490. CreateGridView2RowFromolorObject(arg, i, parentArg);
  491. }
  492. else if (arg.Type == Dtryt.Array)
  493. {
  494. CreateGridView2RowFromArrayObject(arg, i, parentArg);
  495. }
  496. }
  497. /// <summary>
  498. /// 创建小数的NumericUpDown和button
  499. /// </summary>
  500. /// <param name="arg"></param>
  501. /// <param name="i"></param>
  502. private void CreateGridView2RowFromDecimalNumber(Args arg, int i, Args parentArg)
  503. {
  504. Label label = new Label();
  505. label.Text = arg.Name;
  506. label.AutoSize = true;
  507. label.TextAlign = ContentAlignment.MiddleLeft;
  508. NumericUpDown trackBar = new NumericUpDown();
  509. trackBar.DecimalPlaces = ((DecimalNumber)arg).DecimalPlaces;
  510. trackBar.Increment = 0.1M;
  511. trackBar.Tag = arg.Key;
  512. trackBar.Maximum = ((DecimalNumber)arg).Max;
  513. trackBar.Minimum = ((DecimalNumber)arg).Min;
  514. trackBar.Value = decimal.Parse(arg.Value.ToString());
  515. trackBar.ValueChanged += new EventHandler(((DecimalNumber)arg).numberParam_ValueChanged);
  516. Button button = new Button();
  517. //大小设置
  518. label.Size = new Size(100, 23);
  519. trackBar.Size = new Size(73, 23);
  520. button.Size = new Size(23, 23);
  521. //位置设置
  522. label.Margin = new Padding(1, 1, 0, 0);
  523. trackBar.Margin = new Padding(1, 1, 0, 0);
  524. button.Margin = Padding.Empty;
  525. FlowLayoutPanel panel = new FlowLayoutPanel();
  526. panel.BorderStyle = BorderStyle.FixedSingle;
  527. panel.Margin = Padding.Empty;
  528. panel.Height = 25;
  529. panel.Width = 270;
  530. panel.BackColor = Color.White;
  531. panel.Controls.Add(label);
  532. panel.Controls.Add(trackBar);
  533. panel.Controls.Add(button);
  534. panel.Name = arg.Name;
  535. //用于创建并可以找到关系
  536. TagStruct tag = new TagStruct();
  537. tag.args = arg;
  538. tag.parentName = parentArg != null ? parentArg.Name : null;
  539. panel.Tag = tag;
  540. this.flowLayoutPanel1.Controls.Add(panel);
  541. //if (i > 0)
  542. //{
  543. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + 1);
  544. //}
  545. int k = 0;
  546. if (parentArg != null)
  547. {
  548. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  549. if (c != null && c.Length > 0)
  550. {
  551. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  552. }
  553. }
  554. if (i > 0)
  555. {
  556. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  557. }
  558. }
  559. /// <summary>
  560. /// 创建整数的NumericUpDown和button
  561. /// </summary>
  562. /// <param name="arg"></param>
  563. /// <param name="i"></param>
  564. private void CreateGridView2RowFromIntegerNumber(Args arg, int i, Args parentArg)
  565. {
  566. Label label = new Label();
  567. label.Text = arg.Name;
  568. label.TextAlign = ContentAlignment.MiddleLeft;
  569. NumericUpDown trackBar = new NumericUpDown();
  570. trackBar.Increment = 1;
  571. trackBar.Tag = arg.Key;
  572. trackBar.Maximum = ((IntegerNumber)arg).Max;
  573. trackBar.Minimum = ((IntegerNumber)arg).Min;
  574. trackBar.Value = int.Parse(arg.Value.ToString());
  575. trackBar.ValueChanged += new EventHandler(((IntegerNumber)arg).numberParam_ValueChanged);
  576. Button button = new Button();
  577. //大小设置
  578. label.Size = new Size(100, 23);
  579. trackBar.Size = new Size(73, 23);
  580. button.Size = new Size(23, 23);
  581. //边距设置
  582. label.Margin = new Padding(1, 1, 0, 0);
  583. trackBar.Margin = new Padding(1,1,0,0);
  584. button.Margin = Padding.Empty;
  585. FlowLayoutPanel panel = new FlowLayoutPanel();
  586. panel.BorderStyle = BorderStyle.FixedSingle;
  587. panel.Margin = Padding.Empty;
  588. panel.Height = 25;
  589. panel.Width = 270;
  590. panel.BackColor = Color.White;
  591. panel.Controls.Add(label);
  592. panel.Controls.Add(trackBar);
  593. panel.Controls.Add(button);
  594. panel.Name = arg.Name;
  595. //用于创建并可以找到关系
  596. TagStruct tag = new TagStruct();
  597. tag.args = arg;
  598. tag.parentName = parentArg != null ? parentArg.Name : null;
  599. panel.Tag = tag;
  600. this.flowLayoutPanel1.Controls.Add(panel);
  601. //if (i > 0)
  602. //{
  603. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + 1);
  604. //}
  605. int k = 0;
  606. if (parentArg != null)
  607. {
  608. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  609. if (c != null && c.Length > 0)
  610. {
  611. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  612. }
  613. }
  614. if (i > 0)
  615. {
  616. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  617. }
  618. }
  619. /// <summary>
  620. /// 创建奇数的NumericUpDown和button
  621. /// </summary>
  622. /// <param name="arg"></param>
  623. /// <param name="i"></param>
  624. private void CreateGridView2RowFromOddNumber(Args arg, int i, Args parentArg)
  625. {
  626. Label label = new Label();
  627. label.Text = arg.Name;
  628. label.TextAlign = ContentAlignment.MiddleLeft;
  629. NumericUpDown numericUpDown = new NumericUpDown();
  630. numericUpDown.Increment = 2;
  631. numericUpDown.Tag = arg.Key;
  632. numericUpDown.Maximum = ((OddNumber)arg).Max;
  633. numericUpDown.Minimum = ((OddNumber)arg).Min;
  634. numericUpDown.Value = int.Parse(arg.Value.ToString());
  635. numericUpDown.ValueChanged += new EventHandler(((OddNumber)arg).numberParam_ValueChanged);
  636. Button button = new Button();
  637. //添加
  638. //dataGridView2.Controls.Add(trackBar);
  639. //dataGridView2.Controls.Add(button);
  640. //获取大小
  641. //Rectangle rect = dataGridView2.GetCellDisplayRectangle(1, i, true);
  642. //大小设置
  643. label.Size = new Size(100, 23);
  644. numericUpDown.Size = new Size(73, 23);
  645. button.Size = new Size(23, 23);
  646. //边距设置
  647. label.Margin = new Padding(1, 1, 0, 0);
  648. numericUpDown.Margin = new Padding(1, 1, 0, 0);
  649. button.Margin = Padding.Empty;
  650. FlowLayoutPanel panel = new FlowLayoutPanel();
  651. panel.BorderStyle = BorderStyle.FixedSingle;
  652. panel.Margin = Padding.Empty;
  653. panel.Height = 25;
  654. panel.Width = 270;
  655. panel.BackColor = Color.White;
  656. panel.Controls.Add(label);
  657. panel.Controls.Add(numericUpDown);
  658. panel.Controls.Add(button);
  659. panel.Name = arg.Name;
  660. //用于创建并可以找到关系
  661. TagStruct tag = new TagStruct();
  662. tag.args = arg;
  663. tag.parentName = parentArg != null ? parentArg.Name : null;
  664. panel.Tag = tag;
  665. this.flowLayoutPanel1.Controls.Add(panel);
  666. //if (i > 0)
  667. //{
  668. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + 1);
  669. //}
  670. int k = 0;
  671. if (parentArg != null)
  672. {
  673. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  674. if (c != null && c.Length > 0)
  675. {
  676. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  677. }
  678. }
  679. if (i > 0)
  680. {
  681. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  682. }
  683. }
  684. /// <summary>
  685. /// 创建抉择的下拉
  686. /// </summary>
  687. /// <param name="arg"></param>
  688. /// <param name="i"></param>
  689. private void CreateGridView2RowFromChoiseArray(Args arg, int i, Args parentArg)
  690. {
  691. Label label = new Label();
  692. label.Text = arg.Name;
  693. label.TextAlign = ContentAlignment.MiddleLeft;
  694. ComboBox comboBox = new ComboBox();
  695. comboBox.Tag = arg;
  696. comboBox.DataSource = arg.choiseList;
  697. comboBox.ValueMember = "key";
  698. comboBox.DisplayMember = "name";
  699. comboBox.SelectionChangeCommitted += new EventHandler(ChoiseSelectionChange);
  700. //大小设置
  701. label.Size = new Size(100, 23);
  702. comboBox.Size = new Size(96, 23);
  703. //边距设置
  704. label.Margin = new Padding(1, 1, 0, 0);
  705. comboBox.Margin = new Padding(1, 1, 0, 0);
  706. FlowLayoutPanel panel = new FlowLayoutPanel();
  707. panel.BorderStyle = BorderStyle.FixedSingle;
  708. panel.Margin = Padding.Empty;
  709. panel.Height = 25;
  710. panel.Width = 270;
  711. panel.BackColor = Color.White;
  712. panel.Controls.Add(label);
  713. panel.Controls.Add(comboBox);
  714. panel.Name = arg.Name;
  715. //用于创建并可以找到关系
  716. TagStruct tag = new TagStruct();
  717. tag.args = arg;
  718. tag.parentName = parentArg != null ? parentArg.Name : null;
  719. panel.Tag = tag;
  720. this.flowLayoutPanel1.Controls.Add(panel);
  721. //if (i > 0)
  722. //{
  723. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i+1);
  724. //}
  725. int k = 0;
  726. if (parentArg != null)
  727. {
  728. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  729. if (c != null && c.Length > 0)
  730. {
  731. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  732. }
  733. }
  734. if (i > 0)
  735. {
  736. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  737. }
  738. if (arg.choiseList != null && arg.choiseList.Count>0)
  739. {
  740. if (arg.choiseList[0].Lists != null && arg.choiseList[0].Lists.Count > 0)
  741. {
  742. this.CreateParameter(arg.choiseList[0], k, arg);
  743. }
  744. }
  745. }
  746. /// <summary>
  747. /// 创建布尔型是否的下拉
  748. /// </summary>
  749. /// <param name="arg"></param>
  750. /// <param name="i"></param>
  751. private void CreateGridView2RowFromBooleanObject(Args arg, int i, Args parentArg)
  752. {
  753. Label label = new Label();
  754. label.Text = arg.Name;
  755. label.TextAlign = ContentAlignment.MiddleLeft;
  756. ComboBox comboBox = new ComboBox();
  757. comboBox.BindingContext = new BindingContext();
  758. List<string> list = new List<string>();
  759. list.Add("是");
  760. list.Add("否");
  761. comboBox.DataSource = list;
  762. if (arg.value is Boolean && (Boolean)arg.value || arg.value.ToString().Equals("0"))
  763. comboBox.SelectedIndex = 0;
  764. else
  765. comboBox.SelectedIndex = 1;
  766. ////var cbo = new ComboBox();
  767. ////cbo.DropDownStyle = ComboBoxStyle.DropDownList;
  768. //cbo.BindingContext = new BindingContext();
  769. //var cbo.DataSource = new int[] { 1, 2, 3 };
  770. //cbo.SelectedIndex = 0;
  771. //cbo.SelectedIndex = 1;
  772. comboBox.SelectionChangeCommitted += new EventHandler(((BooleanObject)arg).Boolean_ValueChanged);
  773. //大小设置
  774. label.Size = new Size(100, 23);
  775. comboBox.Size = new Size(96, 23);
  776. //边距设置
  777. label.Margin = new Padding(1, 1, 0, 0);
  778. comboBox.Margin = new Padding(1, 1, 0, 0);
  779. FlowLayoutPanel panel = new FlowLayoutPanel();
  780. panel.BorderStyle = BorderStyle.FixedSingle;
  781. panel.Margin = Padding.Empty;
  782. panel.Height = 25;
  783. panel.Width = 270;
  784. panel.BackColor = Color.White;
  785. panel.Controls.Add(label);
  786. panel.Controls.Add(comboBox);
  787. panel.Name = arg.Name;
  788. //用于创建并可以找到关系
  789. TagStruct tag = new TagStruct();
  790. tag.args = arg;
  791. tag.parentName = parentArg != null ? parentArg.Name : null;
  792. panel.Tag = tag;
  793. this.flowLayoutPanel1.Controls.Add(panel);
  794. //if (i > 0)
  795. //{
  796. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + 1);
  797. //}
  798. int k = 0;
  799. if (parentArg != null)
  800. {
  801. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  802. if (c != null && c.Length > 0)
  803. {
  804. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  805. }
  806. }
  807. if (i > 0)
  808. {
  809. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  810. }
  811. }
  812. /// <summary>
  813. /// 创建普通下拉
  814. /// </summary>
  815. /// <param name="arg"></param>
  816. /// <param name="i"></param>
  817. /// <param name="parentArg"></param>
  818. private void CreateGridView2RowFromArrayObject(Args arg, int i, Args parentArg)
  819. {
  820. Label label = new Label();
  821. label.Text = arg.Name;
  822. label.TextAlign = ContentAlignment.MiddleLeft;
  823. ComboBox comboBox = new ComboBox();
  824. BindingSource bs = new BindingSource();
  825. bs.DataSource = (Dictionary<Enum, Object>)arg.initialValue;
  826. comboBox.DataSource = bs;
  827. comboBox.DisplayMember = "Value";
  828. comboBox.ValueMember = "Key";
  829. comboBox.SelectionChangeCommitted += new EventHandler(((StringArray)arg).numberParam_ValueChanged);
  830. //大小设置
  831. label.Size = new Size(100, 23);
  832. comboBox.Size = new Size(96, 23);
  833. //边距设置
  834. label.Margin = new Padding(1, 1, 0, 0);
  835. comboBox.Margin = new Padding(1, 1, 0, 0);
  836. FlowLayoutPanel panel = new FlowLayoutPanel();
  837. panel.BorderStyle = BorderStyle.FixedSingle;
  838. panel.Margin = Padding.Empty;
  839. panel.Height = 25;
  840. panel.Width = 270;
  841. panel.BackColor = Color.White;
  842. panel.Controls.Add(label);
  843. panel.Controls.Add(comboBox);
  844. panel.Name = arg.Name;
  845. //用于创建并可以找到关系
  846. TagStruct tag = new TagStruct();
  847. tag.args = arg;
  848. tag.parentName = parentArg != null ? parentArg.Name : null;
  849. panel.Tag = tag;
  850. this.flowLayoutPanel1.Controls.Add(panel);
  851. //if (i > 0)
  852. //{
  853. // this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + 1);
  854. //}
  855. int k = 0;
  856. if (parentArg != null)
  857. {
  858. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  859. if (c != null && c.Length > 0)
  860. {
  861. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  862. }
  863. }
  864. if (i > 0)
  865. {
  866. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  867. }
  868. }
  869. /// <summary>
  870. /// 创建数字范围的控件
  871. /// </summary>
  872. /// <param name="arg"></param>
  873. /// <param name="i"></param>
  874. /// <param name="parentArg"></param>
  875. private void CreateGridView2RowFromDecimalScope(Args arg, int i, Args parentArg)
  876. {
  877. Label label = new Label();
  878. label.Text = arg.Name;
  879. label.TextAlign = ContentAlignment.MiddleLeft;
  880. //这里需要改成用DecimalScopeControl
  881. DecimalScopeControl decimalScopeControl = new DecimalScopeControl(false);
  882. decimalScopeControl.DecimalPlaces = 0;
  883. decimalScopeControl.minValue = ((List<double>)arg.value)[0];
  884. decimalScopeControl.maxValue = ((List<double>)arg.value)[1];
  885. decimalScopeControl.ValueChanged += new EventHandler(((DecimalScope)arg).numberScope_ValueChanged);
  886. /**
  887. NumericUpDown minNumericUpDown = new NumericUpDown();
  888. minNumericUpDown.DecimalPlaces = 0;
  889. minNumericUpDown.Increment =1;
  890. minNumericUpDown.Maximum = ((DecimalScope)arg).Max;
  891. minNumericUpDown.Minimum = ((DecimalScope)arg).Min;
  892. minNumericUpDown.Value = decimal.Parse(((List<double>)(arg.Value))[0].ToString());
  893. minNumericUpDown.ValueChanged += new EventHandler(((DecimalScope)arg).numberScope_ValueChanged);
  894. NumericUpDown maxNumericUpDown = new NumericUpDown();
  895. maxNumericUpDown.DecimalPlaces = 0;
  896. maxNumericUpDown.Increment = 1;
  897. maxNumericUpDown.Maximum = ((DecimalScope)arg).Max;
  898. maxNumericUpDown.Minimum = ((DecimalScope)arg).Min;
  899. maxNumericUpDown.Value = decimal.Parse(((List<double>)(arg.Value))[1].ToString());
  900. maxNumericUpDown.ValueChanged += new EventHandler(((DecimalScope)arg).numberScope_ValueChanged);
  901. **/
  902. //大小设置
  903. label.Size = new Size(100, 23);
  904. decimalScopeControl.Size = new Size(146 ,23);
  905. //minNumericUpDown.Size = new Size(73, 23);
  906. //maxNumericUpDown.Size = new Size(73, 23);
  907. //边距设置
  908. label.Margin = new Padding(1, 1, 0, 0);
  909. decimalScopeControl.Margin = new Padding(1, 1, 0, 0);
  910. //minNumericUpDown.Margin = new Padding(1, 1, 0, 0);
  911. //maxNumericUpDown.Margin = new Padding(1, 1, 0, 0);
  912. FlowLayoutPanel panel = new FlowLayoutPanel();
  913. panel.BorderStyle = BorderStyle.FixedSingle;
  914. panel.Margin = Padding.Empty;
  915. panel.Height = 25;
  916. panel.Width = 270;
  917. panel.BackColor = Color.White;
  918. panel.Controls.Add(label);
  919. panel.Controls.Add(decimalScopeControl);
  920. //panel.Controls.Add(minNumericUpDown);
  921. //panel.Controls.Add(maxNumericUpDown);
  922. panel.Name = arg.Name;
  923. //用于创建并可以找到关系
  924. TagStruct tag = new TagStruct();
  925. tag.args = arg;
  926. tag.parentName = parentArg != null ? parentArg.Name : null;
  927. panel.Tag = tag;
  928. this.flowLayoutPanel1.Controls.Add(panel);
  929. int k = 0;
  930. if(parentArg!=null)
  931. {
  932. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  933. if(c!=null && c.Length>0)
  934. {
  935. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  936. }
  937. }
  938. if (i > 0)
  939. {
  940. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  941. }
  942. }
  943. /// <summary>
  944. /// 创建颜色选择的控件
  945. /// </summary>
  946. /// <param name="arg"></param>
  947. /// <param name="i"></param>
  948. /// <param name="parentArg"></param>
  949. private void CreateGridView2RowFromolorObject(Args arg, int i, Args parentArg)
  950. {
  951. Label label = new Label();
  952. label.Text = arg.Name;
  953. label.TextAlign = ContentAlignment.MiddleLeft;
  954. Panel colorPanel = new Panel();
  955. colorPanel.BackColor = Color.FromArgb((int)arg.Value);
  956. colorPanel.Click += new EventHandler(this.ColorChoiseEvent);
  957. colorPanel.BackColorChanged += ((ColorNumber)arg).numberParam_ValueChanged;
  958. //大小设置
  959. label.Size = new Size(100, 23);
  960. colorPanel.Size = new Size(146, 23);
  961. //边距设置
  962. label.Margin = new Padding(1, 1, 0, 0);
  963. colorPanel.Margin = new Padding(1, 1, 0, 0);
  964. FlowLayoutPanel panel = new FlowLayoutPanel();
  965. panel.BorderStyle = BorderStyle.FixedSingle;
  966. panel.Margin = Padding.Empty;
  967. panel.Height = 25;
  968. panel.Width = 270;
  969. panel.BackColor = Color.White;
  970. panel.Controls.Add(label);
  971. panel.Controls.Add(colorPanel);
  972. panel.Name = arg.Name;
  973. //用于创建并可以找到关系
  974. TagStruct tag = new TagStruct();
  975. tag.args = arg;
  976. tag.parentName = parentArg != null ? parentArg.Name : null;
  977. panel.Tag = tag;
  978. this.flowLayoutPanel1.Controls.Add(panel);
  979. int k = 0;
  980. if (parentArg != null)
  981. {
  982. Control[] c = this.flowLayoutPanel1.Controls.Find(parentArg.Name, false);
  983. if (c != null && c.Length > 0)
  984. {
  985. k = this.flowLayoutPanel1.Controls.IndexOf(c[0]);
  986. }
  987. }
  988. if (i > 0)
  989. {
  990. this.flowLayoutPanel1.Controls.SetChildIndex(panel, i + k);
  991. }
  992. }
  993. private void ColorChoiseEvent(object sender, EventArgs e)
  994. {
  995. ColorDialog dialog = new ColorDialog();
  996. if(dialog.ShowDialog() == DialogResult.OK)
  997. {
  998. ((Panel)sender).BackColor = dialog.Color;
  999. }
  1000. }
  1001. /// <summary>
  1002. /// 如果是编辑状态
  1003. /// 在第一次显示窗体的时候,进行右侧参数datagridview的初始化
  1004. /// 因为要用到位置信息,所以需要等窗口显示的时候处理
  1005. /// </summary>
  1006. /// <param name="sender"></param>
  1007. /// <param name="e"></param>
  1008. private void ScriptStepDialog_Shown(object sender, EventArgs e)
  1009. {
  1010. if (edit && this.dataGridView1.Rows.Count > 0)
  1011. {
  1012. //高亮
  1013. this.dataGridView1.Rows[0].Selected = true;
  1014. //设置CurrentRow
  1015. this.dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0];
  1016. CreateGridView2Row();
  1017. }
  1018. }
  1019. /// <summary>
  1020. /// 抉择类型的下拉选项变化事件
  1021. /// </summary>
  1022. /// <param name="sender"></param>
  1023. /// <param name="e"></param>
  1024. private void ChoiseSelectionChange(object sender, EventArgs e)
  1025. {
  1026. object tag = ((ComboBox)sender).Tag;
  1027. if (tag!=null)
  1028. {
  1029. Args arg = (Args)tag;
  1030. if (arg.choiseList != null && arg.choiseList.Count > 0)
  1031. {
  1032. //删除旧控件
  1033. list.Clear();
  1034. this.DeleteFromPanelByArg(arg);
  1035. foreach (Control c in list)
  1036. {
  1037. this.flowLayoutPanel1.Controls.Remove(c);
  1038. }
  1039. //添加新控件
  1040. this.CreateParameter(arg.choiseList[((ComboBox)sender).SelectedIndex], 0 , arg);//this.flowLayoutPanel1.Controls.GetChildIndex(((ComboBox)sender).Parent)
  1041. }
  1042. }
  1043. }
  1044. /// <summary>
  1045. /// 删除抉择的控件
  1046. /// </summary>
  1047. /// <param name="arg"></param>
  1048. private void DeleteFromPanelByArg(Args arg)
  1049. {
  1050. foreach (Control c in this.flowLayoutPanel1.Controls)
  1051. {
  1052. if (c.GetType() == typeof(FlowLayoutPanel))
  1053. {
  1054. System.Console.WriteLine(((TagStruct)c.Tag).parentName == null ? "空" : ((TagStruct)c.Tag).parentName);
  1055. if (c.Tag != null)
  1056. {
  1057. if (((TagStruct)c.Tag).parentName!=null && ((TagStruct)c.Tag).parentName.Equals(arg.Name))
  1058. {
  1059. list.Add(c);
  1060. if (((TagStruct)c.Tag).args.GetType() == typeof(ChoiseArray))
  1061. {
  1062. this.DeleteFromPanelByArg(((TagStruct)c.Tag).args);
  1063. }
  1064. }
  1065. }
  1066. }
  1067. }
  1068. }
  1069. /// <summary>
  1070. /// 录制按钮点击事件
  1071. /// </summary>
  1072. /// <param name="sender"></param>
  1073. /// <param name="e"></param>
  1074. private void button6_Click(object sender, EventArgs e)
  1075. {
  1076. }
  1077. }
  1078. }