ToolsMenu.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Base;
  3. using PaintDotNet.Base.CommTool;
  4. using PaintDotNet.Data.Param;
  5. using PaintDotNet.ImageCollect;
  6. using PaintDotNet.Instrument;
  7. using PaintDotNet.SystemLayer;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Diagnostics;
  11. using System.Drawing;
  12. using System.IO;
  13. using System.Linq;
  14. using System.Threading;
  15. using System.Windows.Forms;
  16. namespace PaintDotNet.Menus
  17. {
  18. /// <summary>
  19. /// 工具菜单
  20. /// </summary>
  21. internal sealed class ToolsMenu : PdnMenuItem
  22. {
  23. //网格
  24. private PdnMenuItem menuToolsGridLine;
  25. //辅助线
  26. private PdnMenuItem menuToolsAuxiliaryLine;
  27. //视图标尺
  28. private PdnMenuItem menuToolsViewRuler;
  29. //分隔线
  30. private ToolStripSeparator menuToolsSeperator1;
  31. //捕获窗口
  32. private PdnMenuItem menuToolsCaptureWindow;
  33. //捕获图像
  34. private PdnMenuItem menuToolsCapturePicture;
  35. //分割线
  36. private ToolStripSeparator menuToolsSeperator2;
  37. //直方图
  38. private PdnMenuItem menuToolsHistogram;
  39. //像素跟踪
  40. private PdnMenuItem menuToolsPixelTracking;
  41. //三维灰度
  42. private PdnMenuItem menuToolsSurfacePlot;
  43. //三维展示
  44. private PdnMenuItem menuToolsSurfacePlotShow;
  45. //图像索引
  46. private PdnMenuItem menuToolsImageIndex;
  47. //分隔线
  48. private ToolStripSeparator menuToolsSeperator3;
  49. //脚本
  50. private PdnMenuItem menuToolsScript;
  51. //工作流程
  52. private PdnMenuItem menuToolsWorkFlow;
  53. //快捷工具
  54. private PdnMenuItem menuToolsFast;
  55. //分隔线
  56. private ToolStripSeparator menuToolsSeperator4;
  57. //划痕处理
  58. private PdnMenuItem menuToolsScratchTreatment;
  59. //污迹处理
  60. private PdnMenuItem menuToolsSmudgeTreatment;
  61. //分隔线
  62. private ToolStripSeparator menuToolsSeperator5;
  63. //分栏显示
  64. private PdnMenuItem menuToolsColumnDisplay;
  65. //图片对比
  66. private PdnMenuItem menuToolsPictureComparison;
  67. //自定义界面
  68. private PdnMenuItem menuToolsCustomInterface;
  69. //生成快捷方式
  70. private PdnMenuItem menuToolsCreateShortcut;
  71. //图片信息
  72. private PdnMenuItem menuToolsImageInfo;
  73. //分隔线
  74. private ToolStripSeparator menuToolsSeperator6;
  75. //项目工程
  76. private PdnMenuItem menuToolsOpenProject;
  77. //添加到工程
  78. private PdnMenuItem menuToolsAddToProject;
  79. //分隔线
  80. private ToolStripSeparator menuToolsSeperator7;
  81. //模板管理
  82. private PdnMenuItem menuToolsTemplateManager;
  83. //生成报告
  84. private PdnMenuItem menuToolsCreateReport;
  85. //分隔线
  86. private ToolStripSeparator menuToolsSeperator8;
  87. //重新启动
  88. private PdnMenuItem menuToolsSelfRestart;
  89. //恢复图片
  90. private PdnMenuItem menuToolsRestoreImages;
  91. //
  92. // 以下是非模态对话框
  93. //
  94. //脚本管理窗口
  95. private ScriptManageDialog scriptManageDialog;
  96. public ToolsMenu(int menuId)
  97. {
  98. InitializeComponent();
  99. this.MenuId = menuId;
  100. }
  101. private void InitializeComponent()
  102. {
  103. this.menuToolsGridLine = new PdnMenuItem(ActionType.GridLine, true);
  104. this.menuToolsAuxiliaryLine = new PdnMenuItem(ActionType.AuxiliaryLine, true);
  105. this.menuToolsViewRuler = new PdnMenuItem(ActionType.ViewRuler, true);
  106. this.menuToolsSeperator1 = new ToolStripSeparator();
  107. this.menuToolsCaptureWindow = new PdnMenuItem(ActionType.CaptureWindow);
  108. this.menuToolsCapturePicture = new PdnMenuItem(ActionType.CapturePicture);
  109. this.menuToolsSeperator2 = new ToolStripSeparator();
  110. this.menuToolsHistogram = new PdnMenuItem(ActionType.Histogram);
  111. this.menuToolsPixelTracking = new PdnMenuItem(ActionType.PixelTracking);
  112. this.menuToolsSurfacePlot = new PdnMenuItem(ActionType.SurfacePlot);
  113. this.menuToolsSurfacePlotShow = new PdnMenuItem(ActionType.SurfacePlotShow);
  114. this.menuToolsImageIndex = new PdnMenuItem(ActionType.ImageIndex);
  115. this.menuToolsSeperator3 = new ToolStripSeparator();
  116. this.menuToolsScript = new PdnMenuItem(ActionType.Script);
  117. this.menuToolsWorkFlow = new PdnMenuItem(ActionType.WorkFlow);
  118. this.menuToolsFast = new PdnMenuItem(ActionType.ToolsFast);
  119. this.menuToolsSeperator4 = new ToolStripSeparator();
  120. this.menuToolsScratchTreatment = new PdnMenuItem(ActionType.ScratchTreatment);
  121. this.menuToolsSmudgeTreatment = new PdnMenuItem(ActionType.SmudgeTreatment);
  122. this.menuToolsSeperator5 = new ToolStripSeparator();
  123. this.menuToolsColumnDisplay = new PdnMenuItem(ActionType.ColumnDisplay);
  124. this.menuToolsPictureComparison = new PdnMenuItem(ActionType.PictureComparison);
  125. this.menuToolsCustomInterface = new PdnMenuItem(ActionType.CustomInterface);
  126. this.menuToolsCreateShortcut = new PdnMenuItem(ActionType.CreateShortcut);
  127. this.menuToolsImageInfo = new PdnMenuItem(ActionType.ImageInfo);
  128. this.menuToolsSeperator6 = new ToolStripSeparator();
  129. this.menuToolsOpenProject = new PdnMenuItem(ActionType.OpenProject);
  130. this.menuToolsAddToProject = new PdnMenuItem(ActionType.AddToProject);
  131. this.menuToolsSeperator7 = new ToolStripSeparator();
  132. this.menuToolsTemplateManager = new PdnMenuItem(ActionType.TemplateManager);
  133. this.menuToolsCreateReport = new PdnMenuItem(ActionType.CreateReport);
  134. this.menuToolsSeperator8 = new ToolStripSeparator();
  135. this.menuToolsRestoreImages = new PdnMenuItem(ActionType.RestoreImages);
  136. this.menuToolsSelfRestart = new PdnMenuItem(ActionType.SelfRestart);
  137. //
  138. // ToolsMenu
  139. //
  140. this.DropDownItems.AddRange(
  141. new ToolStripItem[]
  142. {
  143. this.menuToolsGridLine,
  144. this.menuToolsAuxiliaryLine,
  145. this.menuToolsViewRuler,
  146. this.menuToolsSeperator1,
  147. this.menuToolsCaptureWindow,
  148. this.menuToolsCapturePicture,
  149. this.menuToolsSeperator2,
  150. this.menuToolsHistogram,
  151. this.menuToolsPixelTracking,
  152. this.menuToolsSurfacePlot,
  153. this.menuToolsSurfacePlotShow,
  154. this.menuToolsImageIndex,
  155. this.menuToolsSeperator3,
  156. this.menuToolsScript,
  157. this.menuToolsWorkFlow,
  158. this.menuToolsFast,
  159. this.menuToolsSeperator4,
  160. this.menuToolsScratchTreatment,
  161. this.menuToolsSmudgeTreatment,
  162. this.menuToolsSeperator5,
  163. this.menuToolsColumnDisplay,
  164. this.menuToolsPictureComparison,
  165. this.menuToolsCustomInterface,
  166. this.menuToolsCreateShortcut,
  167. this.menuToolsImageInfo,
  168. this.menuToolsSeperator6,
  169. this.menuToolsOpenProject,
  170. this.menuToolsAddToProject,
  171. this.menuToolsSeperator7,
  172. this.menuToolsTemplateManager,
  173. this.menuToolsCreateReport,
  174. this.menuToolsSeperator8,
  175. this.menuToolsRestoreImages,
  176. this.menuToolsSelfRestart
  177. });
  178. this.Name = "Menu.Tools";
  179. this.Text = PdnResources.GetString("Menu.Tools.Text");
  180. //
  181. // 网格
  182. //
  183. this.menuToolsGridLine.Click += new EventHandler(MenuToolsGridLine_Click);
  184. //
  185. // 辅助线
  186. //
  187. this.menuToolsAuxiliaryLine.Click += new EventHandler(MenuToolsAuxiliaryLine_Click);
  188. //
  189. // 视图标尺
  190. //
  191. this.menuToolsViewRuler.Click += new EventHandler(MenuToolsViewRuler_Click);
  192. //
  193. // 捕获窗口
  194. //
  195. this.menuToolsCaptureWindow.Click += new EventHandler(MenuToolsCaptureWindow_Click);
  196. //
  197. // 捕获图片
  198. //
  199. this.menuToolsCapturePicture.Click += new EventHandler(MenuToolsCapturePicture_Click);
  200. //
  201. // 直方图
  202. //
  203. this.menuToolsHistogram.Click += new EventHandler(MenuToolsHistogram_Click);
  204. // 像素跟踪
  205. //
  206. this.menuToolsPixelTracking.Click += new EventHandler(MenuToolsPixelTracking_Click);
  207. //
  208. // 三维灰度
  209. //
  210. this.menuToolsSurfacePlot.Click += new EventHandler(MenuToolsSurfacePlot_Click);
  211. //
  212. // 三维展示
  213. //
  214. this.menuToolsSurfacePlotShow.Click += new EventHandler(MenuToolsSurfacePlotShow_Click);
  215. //
  216. // 图像索引
  217. //
  218. this.menuToolsImageIndex.Click += new EventHandler(MenuToolsImageIndex_Click);
  219. //
  220. // 脚本管理
  221. //
  222. this.menuToolsScript.Click += new EventHandler(MenuToolsScript_Click);
  223. //
  224. // 工作流程
  225. //
  226. this.menuToolsWorkFlow.Click += new EventHandler(MenuToolsWorkFlow_Click);
  227. //
  228. // 快捷菜单
  229. //
  230. this.menuToolsFast.Click += new EventHandler(MenuToolsFast_Click);
  231. //
  232. // 划痕处理
  233. //
  234. this.menuToolsScratchTreatment.Click += new EventHandler(MenuToolsScratchTreatment_Click);
  235. //
  236. // 污迹处理
  237. //
  238. this.menuToolsSmudgeTreatment.Click += new EventHandler(MenuToolsSmudgeTreatment_Click);
  239. //
  240. // 分栏显示
  241. //
  242. this.menuToolsColumnDisplay.Click += new EventHandler(MenuToolsColumnDisplay_Click);
  243. //
  244. // 图片对比
  245. //
  246. this.menuToolsPictureComparison.Click += new EventHandler(MenuToolsPictureComparison_Click);
  247. //
  248. // 自定义界面
  249. //
  250. this.menuToolsCustomInterface.Click += new EventHandler(MenuToolsCustomInterface_Click);
  251. //
  252. // 生成快捷方式
  253. //
  254. this.menuToolsCreateShortcut.Click += new EventHandler(MenuToolsCreateShortcut_Click);
  255. //
  256. // 图片信息
  257. //
  258. this.menuToolsImageInfo.Click += new EventHandler(MenuToolsImageInfo_Click);
  259. //
  260. // 项目工程
  261. //
  262. this.menuToolsOpenProject.Click += new EventHandler(MenuToolsOpenProject_Click);
  263. //
  264. // 添加到工程
  265. //
  266. this.menuToolsAddToProject.Click += new EventHandler(MenuToolsAddToProject_Click);
  267. //
  268. // 模板管理
  269. //
  270. this.menuToolsTemplateManager.Click += new EventHandler(MenuToolsTemplateManager_Click);
  271. //
  272. // 生成报告
  273. //
  274. this.menuToolsCreateReport.Click += new EventHandler(MenuToolsCreateReport_Click);
  275. //
  276. // 恢复图片
  277. //
  278. this.menuToolsRestoreImages.Click += new EventHandler(MenuToolsRestoreImages_Click);
  279. //
  280. // 重新启动
  281. //
  282. this.menuToolsSelfRestart.Click += new EventHandler(MenuToolsSelfRestart_Click);
  283. //
  284. // 加载菜单的文字和icon
  285. //
  286. this.LoadNames(this.Name);
  287. this.LoadIcons();
  288. }
  289. protected override void OnDropDownOpening(EventArgs e)
  290. {
  291. this.menuToolsGridLine.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled : false;
  292. this.menuToolsAuxiliaryLine.Checked = AppWorkspace.ActiveDocumentWorkspace != null ? AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled : false;
  293. this.menuToolsViewRuler.Checked = Settings.CurrentUser.GetBoolean(SettingNames.Rulers, true);
  294. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  295. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  296. this.menuToolsOpenProject.Checked = AppWorkspace.Widgets.ProjectEngineering.Visible;
  297. this.menuToolsWorkFlow.Checked = AppWorkspace.Widgets.WorkFlowDialog.Visible;
  298. this.menuToolsHistogram.Checked = AppWorkspace.Widgets.HistogramDialog.Visible;
  299. this.menuToolsPixelTracking.Checked = AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  300. this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  301. if (SurfacePlotWindow.form != null)
  302. this.menuToolsSurfacePlot.Checked = true;
  303. else
  304. this.menuToolsSurfacePlot.Checked = false;
  305. base.OnDropDownOpening(e);
  306. }
  307. /// <summary>
  308. /// 网格
  309. /// </summary>
  310. /// <param name="sender"></param>
  311. /// <param name="e"></param>
  312. private void MenuToolsGridLine_Click(object sender, EventArgs e)
  313. {
  314. if (AppWorkspace.ActiveDocumentWorkspace != null)
  315. {
  316. if (AppWorkspace.startScriptRecording)
  317. {
  318. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  319. }
  320. AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled = !AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled;
  321. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled, "GridLine");
  322. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.GridLineEnabled, "GridLine");
  323. AppWorkspace.UpdateBottomButtonSelectionStatus();
  324. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  325. }
  326. }
  327. /// <summary>
  328. /// 辅助线
  329. /// </summary>
  330. /// <param name="sender"></param>
  331. /// <param name="e"></param>
  332. private void MenuToolsAuxiliaryLine_Click(object sender, EventArgs e)
  333. {
  334. if(AppWorkspace.ActiveDocumentWorkspace!=null)
  335. {
  336. if (AppWorkspace.startScriptRecording)
  337. {
  338. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  339. }
  340. AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled = !Settings.CurrentUser.GetBoolean(SettingNames.DrawAuxiliaryLine, false);
  341. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled, "AuxiliaryLine");
  342. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled, "AuxiliaryLine");
  343. Settings.CurrentUser.SetBoolean(SettingNames.DrawAuxiliaryLine, AppWorkspace.ActiveDocumentWorkspace.AuxiliaryLineEnabled);
  344. AppWorkspace.UpdateBottomButtonSelectionStatus();
  345. AppWorkspace.ActiveDocumentWorkspace.Refresh();
  346. }
  347. }
  348. /// <summary>
  349. /// 隐藏显示标尺
  350. /// </summary>
  351. /// <param name="sender"></param>
  352. /// <param name="e"></param>
  353. private void MenuToolsViewRuler_Click(object sender, EventArgs e)
  354. {
  355. if (AppWorkspace.ActiveDocumentWorkspace != null)
  356. {
  357. if (AppWorkspace.startScriptRecording)
  358. {
  359. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  360. }
  361. AppWorkspace.ActiveDocumentWorkspace.RulersEnabled = !Settings.CurrentUser.GetBoolean(SettingNames.Rulers, false);
  362. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.RulersEnabled, "ViewRuler");
  363. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.ActiveDocumentWorkspace.RulersEnabled, "ViewRuler");
  364. Settings.CurrentUser.SetBoolean(SettingNames.Rulers, AppWorkspace.ActiveDocumentWorkspace.RulersEnabled);
  365. }
  366. }
  367. /// <summary>
  368. /// 捕获屏幕
  369. /// </summary>
  370. /// <param name="sender"></param>
  371. /// <param name="e"></param>
  372. private void MenuToolsCaptureWindow_Click(object sender, EventArgs e)
  373. {
  374. if (AppWorkspace.startScriptRecording)
  375. {
  376. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  377. }
  378. Bitmap myImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
  379. Graphics g = Graphics.FromImage(myImage);
  380. g.CopyFromScreen(new System.Drawing.Point(0, 0), new System.Drawing.Point(0, 0), new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height));
  381. g.Dispose();
  382. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  383. Document document = Document.FromImage(myImage);
  384. dw.Document = document;
  385. dw.xmlSaveModel = Startup.instance.ruleDB;
  386. dw.InitRulerInfo();
  387. dw.fileText = PdnResources.GetString("Menu.Tools.CaptureWindow.Text")+"-00" + Startup.instance.step_length;
  388. AppWorkspace.ActiveDocumentWorkspace = dw;
  389. Startup.instance.step_length += 1;
  390. }
  391. /// <summary>
  392. /// 捕获图片,这个功能临时当作copy的功能
  393. /// 但是这个功能最终是和定倍有关系的
  394. /// </summary>
  395. /// <param name="sender"></param>
  396. /// <param name="e"></param>
  397. private void MenuToolsCapturePicture_Click(object sender, EventArgs e)
  398. {
  399. if(AppWorkspace.ActiveDocumentWorkspace != null)
  400. {
  401. if (AppWorkspace.startScriptRecording)
  402. {
  403. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  404. }
  405. Document document = Document.FromImage(AppWorkspace.ActiveDocumentWorkspace.GetClientRangePic());
  406. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  407. dw.Document = document;
  408. dw.xmlSaveModel = this.AppWorkspace.ActiveDocumentWorkspace.xmlSaveModel;
  409. dw.rules = this.AppWorkspace.ActiveDocumentWorkspace.rules;
  410. dw.fileText = PdnResources.GetString("Menu.Tools.CapturePicture.Text") +"-00" + Startup.instance.step_length;
  411. AppWorkspace.ActiveDocumentWorkspace = dw;
  412. Startup.instance.step_length += 1;
  413. }
  414. }
  415. /// <summary>
  416. /// 直方图
  417. /// </summary>
  418. /// <param name="sender"></param>
  419. /// <param name="e"></param>
  420. private void MenuToolsHistogram_Click(object sender, EventArgs e)
  421. {
  422. if (AppWorkspace.startScriptRecording)
  423. {
  424. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  425. }
  426. if (AppWorkspace.ActiveDocumentWorkspace != null)
  427. {
  428. AppWorkspace.Widgets.HistogramDialog.Visible = !AppWorkspace.Widgets.HistogramDialog.Visible;
  429. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.HistogramDialog.Visible, "Histogram");
  430. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.HistogramDialog.Visible, "Histogram");
  431. this.menuToolsHistogram.Checked = AppWorkspace.Widgets.HistogramDialog.Visible;
  432. }
  433. else
  434. {
  435. if (AppWorkspace.Widgets.HistogramDialog.Visible == false)
  436. {
  437. MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenthepicture.Text"));//后可以使用直方图
  438. }
  439. else
  440. AppWorkspace.Widgets.HistogramDialog.Visible = false;
  441. }
  442. if (AppWorkspace.ActiveDocumentWorkspace != null)
  443. {
  444. if (this.AppWorkspace.ActiveDocumentWorkspace.best)
  445. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 0;
  446. else if (this.AppWorkspace.ActiveDocumentWorkspace.maxMin)
  447. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 1;
  448. else if (this.AppWorkspace.ActiveDocumentWorkspace.gamma45)
  449. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 2;
  450. else if (this.AppWorkspace.ActiveDocumentWorkspace.origin)
  451. this.AppWorkspace.ActiveDocumentWorkspace.buttonType = 3;
  452. this.AppWorkspace.RefreshHistogram();
  453. AppWorkspace.ActiveDocumentWorkspace.Focus();
  454. }
  455. //using (HistogramDialog dialog = new HistogramDialog(AppWorkspace))
  456. //{
  457. // dialog.ShowDialog();
  458. //}
  459. }
  460. /// <summary>
  461. /// 像素跟踪
  462. /// </summary>
  463. /// <param name="sender"></param>
  464. /// <param name="e"></param>
  465. private void MenuToolsPixelTracking_Click(object sender, EventArgs e)
  466. {
  467. if (AppWorkspace.startScriptRecording)
  468. {
  469. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  470. }
  471. AppWorkspace.Widgets.PixelTrackingDialog.Visible = !AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  472. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.PixelTrackingDialog.Visible, "PixelTracking");
  473. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.PixelTrackingDialog.Visible, "PixelTracking");
  474. this.menuToolsPixelTracking.Checked = AppWorkspace.Widgets.PixelTrackingDialog.Visible;
  475. if (CameraPreviewDialog.cameraPreviewDialog != null)
  476. CameraPreviewDialog.cameraPreviewDialog.documentWorkspace.Focus();
  477. if (AppWorkspace.ActiveDocumentWorkspace != null)
  478. {
  479. AppWorkspace.ActiveDocumentWorkspace.Focus();
  480. }
  481. }
  482. /// <summary>
  483. /// 三维灰度
  484. /// </summary>
  485. /// <param name="sender"></param>
  486. /// <param name="e"></param>
  487. private void MenuToolsSurfacePlot_Click(object sender, EventArgs e)
  488. {
  489. if (AppWorkspace.ActiveDocumentWorkspace != null)
  490. {
  491. if (AppWorkspace.startScriptRecording)
  492. {
  493. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  494. }
  495. if (SurfacePlotWindow.form != null)
  496. {
  497. SurfacePlotWindow.form.Close();
  498. this.menuToolsSurfacePlot.Checked = false;
  499. }
  500. else
  501. {
  502. SurfacePlotWindow.Run(this.AppWorkspace);
  503. this.menuToolsSurfacePlot.Checked = true;
  504. }
  505. }
  506. /*RegularTetrahedron3D*/
  507. else
  508. MessageBox.Show(PdnResources.GetString("Menu.Pleaseopenthepicture.Text"));
  509. }
  510. /// <summary>
  511. /// 三维显示
  512. /// </summary>
  513. /// <param name="sender"></param>
  514. /// <param name="e"></param>
  515. private void MenuToolsSurfacePlotShow_Click(object sender, EventArgs e)
  516. {
  517. using (ImageThreeDShowDialog imageDepthExtensionDialog = new ImageThreeDShowDialog(this.AppWorkspace))
  518. {
  519. if (AppWorkspace.startScriptRecording)
  520. {
  521. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  522. }
  523. imageDepthExtensionDialog.StartPosition = FormStartPosition.CenterScreen;
  524. imageDepthExtensionDialog.ShowDialog();
  525. }
  526. }
  527. /// <summary>
  528. /// 图像索引
  529. /// </summary>
  530. /// <param name="sender"></param>
  531. /// <param name="e"></param>
  532. private void MenuToolsImageIndex_Click(object sender, EventArgs e)
  533. {
  534. if (AppWorkspace.startScriptRecording)
  535. {
  536. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  537. }
  538. AppWorkspace.Widgets.ImageIndexDialog.Visible = !AppWorkspace.Widgets.ImageIndexDialog.Visible;
  539. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ImageIndexDialog.Visible, "ImageIndex");
  540. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ImageIndexDialog.Visible, "ImageIndex");
  541. AppWorkspace.Widgets.ImageIndexDialog.Width = AppWorkspace.Widgets.ImageIndexDialog.fromMinSize;
  542. this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  543. if (AppWorkspace.ActiveDocumentWorkspace != null)
  544. {
  545. AppWorkspace.ActiveDocumentWorkspace.Focus();
  546. }
  547. //ImageIndexDialog dialog = new ImageIndexDialog(AppWorkspace,816);
  548. //dialog.ShowDialog();
  549. //Form form = Application.OpenForms["ImageIndexDialog"];//尝试获取已经弹出的窗口对象
  550. //FloatingFormMethod.ShowFloatForm(form, form == null ? new ImageIndexDialog(AppWorkspace)/*没有弹出的窗口对象则创建*/ : null, AppWorkspace);
  551. //this.menuToolsImageIndex.Checked = AppWorkspace.Widgets.ImageIndexDialog.Visible;
  552. }
  553. /// <summary>
  554. /// 脚本
  555. /// </summary>
  556. /// <param name="sender"></param>
  557. /// <param name="e"></param>
  558. private void MenuToolsScript_Click(object sender, EventArgs e)
  559. {
  560. if (AppWorkspace.startScriptRecording)
  561. {
  562. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  563. }
  564. scriptManageDialog = (ScriptManageDialog)Application.OpenForms["ScriptManageDialog"];//尝试获取已经弹出的窗口对象
  565. bool nullFLag = false;
  566. if (scriptManageDialog == null)
  567. {
  568. nullFLag = true;
  569. scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  570. AppWorkspace.ScriptDialog = scriptManageDialog;
  571. }
  572. FloatingFormMethod.ShowFloatForm(nullFLag ? null : scriptManageDialog, scriptManageDialog, AppWorkspace);
  573. //if (scriptManageDialog == null)
  574. //{
  575. // scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  576. // AppWorkspace.ScriptDialog = scriptManageDialog;
  577. // scriptManageDialog.StartPosition = FormStartPosition.CenterScreen;
  578. // scriptManageDialog.Show();
  579. //}
  580. //else
  581. //{
  582. // if (!scriptManageDialog.IsDisposed)
  583. // {
  584. // scriptManageDialog.WindowState = FormWindowState.Normal;
  585. // }
  586. // else
  587. // {
  588. // scriptManageDialog = new ScriptManageDialog(AppWorkspace);
  589. // AppWorkspace.ScriptDialog = scriptManageDialog;
  590. // scriptManageDialog.StartPosition = FormStartPosition.CenterScreen;
  591. // scriptManageDialog.Show();
  592. // }
  593. //}
  594. }
  595. /// <summary>
  596. /// 工作流程
  597. /// </summary>
  598. /// <param name="sender"></param>
  599. /// <param name="e"></param>
  600. private void MenuToolsWorkFlow_Click(object sender, EventArgs e)
  601. {
  602. if (AppWorkspace.startScriptRecording)
  603. {
  604. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  605. }
  606. AppWorkspace.Widgets.WorkFlowDialog.Visible = !AppWorkspace.Widgets.WorkFlowDialog.Visible;
  607. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.WorkFlowDialog.Visible, "WorkFlow");
  608. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.WorkFlowDialog.Visible, "WorkFlow");
  609. this.menuToolsWorkFlow.Checked = AppWorkspace.Widgets.WorkFlowDialog.Visible;
  610. if (AppWorkspace.ActiveDocumentWorkspace != null)
  611. {
  612. AppWorkspace.ActiveDocumentWorkspace.Focus();
  613. }
  614. }
  615. /// <summary>
  616. /// 快捷菜单
  617. /// </summary>
  618. /// <param name="sender"></param>
  619. /// <param name="e"></param>
  620. private void MenuToolsFast_Click(object sender, EventArgs e)
  621. {
  622. if (AppWorkspace != null)
  623. {
  624. if (AppWorkspace.startScriptRecording)
  625. {
  626. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  627. }
  628. AppWorkspace.toolsPanel.Visible = !AppWorkspace.toolsPanel.Visible;
  629. }
  630. }
  631. /// <summary>
  632. /// 划痕处理
  633. /// </summary>
  634. /// <param name="sender"></param>
  635. /// <param name="e"></param>
  636. private void MenuToolsScratchTreatment_Click(object sender, EventArgs e)
  637. {
  638. if (AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible)
  639. AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible = false;
  640. if (AppWorkspace.ActiveDocumentWorkspace != null)
  641. AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawScratchTreatmentLine;
  642. if (AppWorkspace.ActiveDocumentWorkspace != null)
  643. {
  644. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  645. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  646. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  647. AppWorkspace.Widgets.ScratchTreatmentDialog.Visible = !AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  648. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  649. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  650. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  651. }
  652. }
  653. /// <summary>
  654. /// 污迹处理
  655. /// </summary>
  656. /// <param name="sender"></param>
  657. /// <param name="e"></param>
  658. private void MenuToolsSmudgeTreatment_Click(object sender, EventArgs e)
  659. {
  660. //if (AppWorkspace.ActiveDocumentWorkspace != null)
  661. //{
  662. // AppWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.DrawSmudgeRectangle;// DrawSmudgePolygon;// DrawSmudgeEllipse;//
  663. //}
  664. if (AppWorkspace.Widgets.ScratchTreatmentDialog.Visible)
  665. AppWorkspace.Widgets.ScratchTreatmentDialog.Visible = false;
  666. AppWorkspace.Widgets.SmudgeTreatmentDialog.RefreshActiveTool();
  667. if (AppWorkspace.ActiveDocumentWorkspace != null)
  668. {
  669. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  670. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ScratchTreatmentDialog.Visible, "ScratchTreatment");
  671. this.menuToolsScratchTreatment.Checked = AppWorkspace.Widgets.ScratchTreatmentDialog.Visible;
  672. AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible = !AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  673. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  674. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible, "SmudgeTreatment");
  675. this.menuToolsSmudgeTreatment.Checked = AppWorkspace.Widgets.SmudgeTreatmentDialog.Visible;
  676. }
  677. }
  678. /// <summary>
  679. /// 自定义界面
  680. /// </summary>
  681. /// <param name="sender"></param>
  682. /// <param name="e"></param>
  683. private void MenuToolsCustomInterface_Click(object sender, EventArgs e)
  684. {
  685. if (AppWorkspace.startScriptRecording)
  686. {
  687. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  688. }
  689. CustomInterfaceDialog dialog = new CustomInterfaceDialog(AppWorkspace);
  690. dialog.ShowDialog();
  691. }
  692. /// <summary>
  693. /// 软件重启
  694. /// </summary>
  695. /// <param name="sender"></param>
  696. /// <param name="e"></param>
  697. private void MenuToolsSelfRestart_Click(object sender, EventArgs e)
  698. {
  699. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.orestartthesoftwareModifiedimageswillnotbesaved.Text")+"!", PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  700. if (dr == DialogResult.OK)
  701. {
  702. if (AppWorkspace.startScriptRecording)
  703. {
  704. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  705. }
  706. FileOperationHelper.DeleteFolder(Application.StartupPath + "\\BackupImages");//删除备份文件
  707. FileOperationHelper.DeleteFolder(Application.StartupPath + "\\BackupImagesTemp");//删除备份文件
  708. Application.ExitThread();
  709. Restart();
  710. }
  711. //Startup.CloseApplication();
  712. //SystemLayer.Shell.RestartApplication();
  713. }
  714. /// <summary>
  715. /// 恢复图片
  716. /// </summary>
  717. /// <param name="sender"></param>
  718. /// <param name="e"></param>
  719. private void MenuToolsRestoreImages_Click(object sender, EventArgs e)
  720. {
  721. List<string> imageList = FileOperationHelper.RestoreImages();
  722. if (AppWorkspace.startScriptRecording)
  723. {
  724. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  725. }
  726. if (imageList != null && imageList.Count > 0)
  727. {
  728. foreach (string imgName in imageList)
  729. {
  730. Document document = Document.FromImage(Image.FromFile(imgName));
  731. DocumentWorkspace dw = AppWorkspace.AddNewDocumentWorkspace();
  732. dw.Document = document;
  733. dw.fileText = Path.GetFileNameWithoutExtension(imgName);
  734. AppWorkspace.ActiveDocumentWorkspace = dw;
  735. }
  736. }
  737. else
  738. MessageBox.Show(PdnResources.GetString("Menu.Therearenopicturestorecover.Text"));
  739. }
  740. private void Restart()
  741. {
  742. Thread thtmp = new Thread(new ParameterizedThreadStart(run));
  743. object appName = Application.ExecutablePath;
  744. Thread.Sleep(2000);
  745. thtmp.Start(appName);
  746. }
  747. private void run(Object obj)
  748. {
  749. Process ps = new Process();
  750. ps.StartInfo.FileName = obj.ToString();
  751. ps.Start();
  752. }
  753. /// <summary>
  754. /// 分栏显示
  755. /// </summary>
  756. /// <param name="sender"></param>
  757. /// <param name="e"></param>
  758. private void MenuToolsColumnDisplay_Click(object sender, EventArgs e)
  759. {
  760. using (ColumnsShowDialog columnsShowDialog = new ColumnsShowDialog(this.AppWorkspace))
  761. {
  762. if (AppWorkspace.startScriptRecording)
  763. {
  764. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  765. }
  766. columnsShowDialog.StartPosition = FormStartPosition.CenterScreen;
  767. columnsShowDialog.ShowDialog();
  768. }
  769. }
  770. /// <summary>
  771. /// 图片信息
  772. /// </summary>
  773. /// <param name="sender"></param>
  774. /// <param name="e"></param>
  775. private void MenuToolsImageInfo_Click(object sender, EventArgs e)
  776. {
  777. using (ImageInformation imageInformation = new ImageInformation(this.AppWorkspace))
  778. {
  779. if (AppWorkspace.startScriptRecording)
  780. {
  781. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  782. }
  783. imageInformation.StartPosition = FormStartPosition.CenterScreen;
  784. imageInformation.ShowDialog();
  785. }
  786. }
  787. /// <summary>
  788. /// 项目工程
  789. /// </summary>
  790. /// <param name="sender"></param>
  791. /// <param name="e"></param>
  792. private void MenuToolsOpenProject_Click(object sender, EventArgs e)
  793. {
  794. AppWorkspace.Widgets.ProjectEngineering.Visible = !AppWorkspace.Widgets.ProjectEngineering.Visible;
  795. if (AppWorkspace.ActiveDocumentWorkspace != null)
  796. {
  797. if (AppWorkspace.startScriptRecording)
  798. {
  799. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  800. }
  801. this.AppWorkspace.toolBar.RefreshBtnSelect(AppWorkspace.Widgets.ProjectEngineering.Visible, "OpenProject");
  802. this.AppWorkspace.toolsPanel.RefreshBtnSelect(AppWorkspace.Widgets.ProjectEngineering.Visible, "OpenProject");
  803. this.menuToolsOpenProject.Checked = AppWorkspace.Widgets.ProjectEngineering.Visible;
  804. AppWorkspace.ActiveDocumentWorkspace.Focus();
  805. }
  806. }
  807. /// <summary>
  808. /// 添加到工程
  809. /// 1、如果项目工程选择了常规操作,可以任意添加
  810. /// 2、如果项目工程选择了通用分析、专用分析,则必须选择其下的文件夹或项目进行添加
  811. /// </summary>
  812. /// <param name="sender"></param>
  813. /// <param name="e"></param>
  814. private void MenuToolsAddToProject_Click(object sender, EventArgs e)
  815. {
  816. if (AppWorkspace.startScriptRecording)
  817. {
  818. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  819. }
  820. //如果选择了文件夹,则添加到工程
  821. if (AppWorkspace.Widgets.ProjectEngineering.TreeNode!=null)
  822. {
  823. AppWorkspace.Widgets.ProjectEngineering.AddToProject();
  824. }
  825. //如果没有选择则提示,用户选择文件夹,并显示出来项目工程窗口
  826. else
  827. {
  828. AppWorkspace.Widgets.ProjectEngineering.Visible = true;
  829. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheprojectprojectnode.Text"));
  830. }
  831. }
  832. /// <summary>
  833. /// 图像对比
  834. /// </summary>
  835. /// <param name="sender"></param>
  836. /// <param name="e"></param>
  837. private void MenuToolsPictureComparison_Click(object sender, EventArgs e)
  838. {
  839. using (ImageComparison imageComparison = new ImageComparison(this.AppWorkspace))
  840. {
  841. if (AppWorkspace.startScriptRecording)
  842. {
  843. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  844. }
  845. imageComparison.StartPosition = FormStartPosition.CenterScreen;
  846. imageComparison.ShowDialog();
  847. }
  848. }
  849. /// <summary>
  850. /// 生成快捷方式
  851. /// </summary>
  852. /// <param name="sender"></param>
  853. /// <param name="e"></param>
  854. private void MenuToolsCreateShortcut_Click(object sender, EventArgs e)
  855. {
  856. if (AppWorkspace != null)
  857. {
  858. if (AppWorkspace.startScriptRecording)
  859. {
  860. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  861. }
  862. AppWorkspace.DoSaveLnk();
  863. }
  864. }
  865. /// <summary>
  866. /// 模板管理
  867. /// </summary>
  868. /// <param name="sender"></param>
  869. /// <param name="e"></param>
  870. private void MenuToolsTemplateManager_Click(object sender, EventArgs e)
  871. {
  872. using (TemplateManagerDialog dialog = new TemplateManagerDialog())
  873. {
  874. if (AppWorkspace.startScriptRecording)
  875. {
  876. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  877. }
  878. dialog.StartPosition = FormStartPosition.CenterParent;
  879. dialog.ShowDialog();
  880. }
  881. }
  882. /// <summary>
  883. /// 生成报告
  884. /// </summary>
  885. /// <param name="sender"></param>
  886. /// <param name="e"></param>
  887. private void MenuToolsCreateReport_Click(object sender, EventArgs e)
  888. {
  889. if (AppWorkspace.DocumentWorkspaces != null && AppWorkspace.DocumentWorkspaces.Count() > 0)
  890. {
  891. if (AppWorkspace.startScriptRecording)
  892. {
  893. AppWorkspace.SetScriptStartRecording(((PdnMenuItem)sender).MenuId, ((PdnMenuItem)sender).Text, new List<Args>());
  894. }
  895. using (CreateReportDialog createReportDialog = new CreateReportDialog(this.AppWorkspace))
  896. {
  897. createReportDialog.StartPosition = FormStartPosition.CenterScreen;
  898. createReportDialog.ShowDialog();
  899. }
  900. }
  901. else
  902. MessageBox.Show(PdnResources.GetString("Menu.Thereportcannotbegeneratedwithoutanopenim.Text"));
  903. }
  904. }
  905. }