OpenViewDialog.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Annotation.FieldView;
  3. using PaintDotNet.Base.CommTool;
  4. using PaintDotNet.DbOpreate.DbBll;
  5. using PaintDotNet.DbOpreate.DbModel;
  6. using PaintDotNet.Base.SettingModel.LVMModel;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Drawing;
  10. using System.Drawing.Drawing2D;
  11. using System.Drawing.Imaging;
  12. using System.Windows.Forms;
  13. namespace PaintDotNet.FieldView
  14. {
  15. internal class OpenViewDialog : PdnBaseForm
  16. {
  17. #region 控件
  18. private GroupBox groupBox1;
  19. private GroupBox groupBox2;
  20. private GroupBox groupBox3;
  21. private GroupBox groupBox4;
  22. private ListView listView1;
  23. private Panel panel1;
  24. private PictureBox pictureBox1;
  25. private AppWorkspace appWorkspace;
  26. private Button button4;
  27. private Button button3;
  28. private Button button2;
  29. private Button button1;
  30. private Label label1;
  31. #endregion
  32. /// <summary>
  33. /// 重命名
  34. /// </summary>
  35. private EditViewDialog createNameDialog;
  36. /// <summary>
  37. /// 选定的视场在listview的items内的下标
  38. /// </summary>
  39. private int index = -1;
  40. /// <summary>
  41. /// 视场数据
  42. /// </summary>
  43. private List<mic_view_infos> list;
  44. /// <summary>
  45. /// 选定的视场数据的model
  46. /// </summary>
  47. private ViewListModel viewListModel;
  48. public OpenViewDialog(AppWorkspace appWorkspace)
  49. {
  50. this.appWorkspace = appWorkspace;
  51. InitializeComponent();
  52. InitializeLanguageText();
  53. InitListViewHeader();
  54. InitViewData();
  55. }
  56. private void InitListViewHeader()
  57. {
  58. this.listView1.View = View.Details;
  59. ColumnHeader header0 = new ColumnHeader();
  60. header0.Text = "";
  61. header0.Width = 25;
  62. this.listView1.Columns.Add(header0);
  63. ColumnHeader header = new ColumnHeader();
  64. header.Text = PdnResources.GetString("Menu.viewname.text");
  65. header.Width = 150;
  66. this.listView1.Columns.Add(header);
  67. }
  68. private void InitViewData()
  69. {
  70. this.listView1.Items.Clear();
  71. list = mic_view_infos_BLL.FindAll();
  72. if (list != null)
  73. {
  74. for (int i = 0; i < list.Count; i++)
  75. {
  76. mic_view_infos view = list[i];
  77. ListViewItem item = new ListViewItem();
  78. item.Tag = view.id;
  79. item.Text = "";
  80. item.SubItems.Add(view.view_name);
  81. this.listView1.Items.Add(item);
  82. }
  83. }
  84. }
  85. private void InitializeLanguageText()
  86. {
  87. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  88. this.button4.Text = PdnResources.GetString("Menu.Rename.text");
  89. this.button3.Text = PdnResources.GetString("Menu.viewsetting.Openview.Openrecord.text");
  90. this.button2.Text = PdnResources.GetString("Menu.viewsetting.Openview.DeleteRecord.text");
  91. this.button1.Text = PdnResources.GetString("Menu.Applyall.text");
  92. this.groupBox2.Text = PdnResources.GetString("Menu.viewsetting.Openview.List.text");
  93. this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
  94. this.groupBox4.Text = PdnResources.GetString("Menu.viewsetting.Openview.brief.text");
  95. this.Text = PdnResources.GetString("Menu.ViewSetting.OpenFieldOfView.Text");
  96. }
  97. private void InitializeComponent()
  98. {
  99. this.groupBox1 = new System.Windows.Forms.GroupBox();
  100. this.button4 = new System.Windows.Forms.Button();
  101. this.button3 = new System.Windows.Forms.Button();
  102. this.button2 = new System.Windows.Forms.Button();
  103. this.button1 = new System.Windows.Forms.Button();
  104. this.groupBox2 = new System.Windows.Forms.GroupBox();
  105. this.listView1 = new System.Windows.Forms.ListView();
  106. this.groupBox3 = new System.Windows.Forms.GroupBox();
  107. this.panel1 = new System.Windows.Forms.Panel();
  108. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  109. this.groupBox4 = new System.Windows.Forms.GroupBox();
  110. this.label1 = new System.Windows.Forms.Label();
  111. this.groupBox1.SuspendLayout();
  112. this.groupBox2.SuspendLayout();
  113. this.groupBox3.SuspendLayout();
  114. this.panel1.SuspendLayout();
  115. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  116. this.groupBox4.SuspendLayout();
  117. this.SuspendLayout();
  118. //
  119. // groupBox1
  120. //
  121. this.groupBox1.Controls.Add(this.button4);
  122. this.groupBox1.Controls.Add(this.button3);
  123. this.groupBox1.Controls.Add(this.button2);
  124. this.groupBox1.Controls.Add(this.button1);
  125. this.groupBox1.Location = new System.Drawing.Point(13, 13);
  126. this.groupBox1.Name = "groupBox1";
  127. this.groupBox1.Size = new System.Drawing.Size(526, 46);
  128. this.groupBox1.TabIndex = 1;
  129. this.groupBox1.TabStop = false;
  130. this.groupBox1.Text = "操作";
  131. //
  132. // button4
  133. //
  134. this.button4.Location = new System.Drawing.Point(445, 14);
  135. this.button4.Name = "button4";
  136. this.button4.Size = new System.Drawing.Size(75, 23);
  137. this.button4.TabIndex = 1;
  138. this.button4.Text = "重命名";
  139. this.button4.UseVisualStyleBackColor = true;
  140. this.button4.Click += new System.EventHandler(this.button4_Click);
  141. //
  142. // button3
  143. //
  144. this.button3.Location = new System.Drawing.Point(364, 14);
  145. this.button3.Name = "button3";
  146. this.button3.Size = new System.Drawing.Size(75, 23);
  147. this.button3.TabIndex = 2;
  148. this.button3.Text = "打开记录";
  149. this.button3.UseVisualStyleBackColor = true;
  150. this.button3.Click += new System.EventHandler(this.button3_Click);
  151. //
  152. // button2
  153. //
  154. this.button2.Location = new System.Drawing.Point(283, 14);
  155. this.button2.Name = "button2";
  156. this.button2.Size = new System.Drawing.Size(75, 23);
  157. this.button2.TabIndex = 1;
  158. this.button2.Text = "删除记录";
  159. this.button2.UseVisualStyleBackColor = true;
  160. this.button2.Click += new System.EventHandler(this.button2_Click);
  161. //
  162. // button1
  163. //
  164. this.button1.Location = new System.Drawing.Point(202, 14);
  165. this.button1.Name = "button1";
  166. this.button1.Size = new System.Drawing.Size(75, 23);
  167. this.button1.TabIndex = 0;
  168. this.button1.Text = "应用全部";
  169. this.button1.UseVisualStyleBackColor = true;
  170. this.button1.Click += new System.EventHandler(this.button1_Click);
  171. //
  172. // groupBox2
  173. //
  174. this.groupBox2.Controls.Add(this.listView1);
  175. this.groupBox2.Location = new System.Drawing.Point(13, 66);
  176. this.groupBox2.Name = "groupBox2";
  177. this.groupBox2.Size = new System.Drawing.Size(200, 295);
  178. this.groupBox2.TabIndex = 2;
  179. this.groupBox2.TabStop = false;
  180. this.groupBox2.Text = "列表";
  181. //
  182. // listView1
  183. //
  184. this.listView1.FullRowSelect = true;
  185. this.listView1.HideSelection = false;
  186. this.listView1.Location = new System.Drawing.Point(7, 21);
  187. this.listView1.MultiSelect = false;
  188. this.listView1.Name = "listView1";
  189. this.listView1.Size = new System.Drawing.Size(187, 268);
  190. this.listView1.TabIndex = 0;
  191. this.listView1.UseCompatibleStateImageBehavior = false;
  192. this.listView1.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listView1_ItemSelectionChanged);
  193. //
  194. // groupBox3
  195. //
  196. this.groupBox3.Controls.Add(this.panel1);
  197. this.groupBox3.Location = new System.Drawing.Point(220, 66);
  198. this.groupBox3.Name = "groupBox3";
  199. this.groupBox3.Size = new System.Drawing.Size(319, 295);
  200. this.groupBox3.TabIndex = 3;
  201. this.groupBox3.TabStop = false;
  202. this.groupBox3.Text = "预览";
  203. //
  204. // panel1
  205. //
  206. this.panel1.BackColor = System.Drawing.Color.Black;
  207. this.panel1.Controls.Add(this.pictureBox1);
  208. this.panel1.Location = new System.Drawing.Point(7, 21);
  209. this.panel1.Name = "panel1";
  210. this.panel1.Size = new System.Drawing.Size(306, 268);
  211. this.panel1.TabIndex = 0;
  212. //
  213. // pictureBox1
  214. //
  215. this.pictureBox1.BackColor = System.Drawing.Color.Black;
  216. this.pictureBox1.Location = new System.Drawing.Point(3, 3);
  217. this.pictureBox1.Name = "pictureBox1";
  218. this.pictureBox1.Size = new System.Drawing.Size(300, 262);
  219. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
  220. this.pictureBox1.TabIndex = 0;
  221. this.pictureBox1.TabStop = false;
  222. //
  223. // groupBox4
  224. //
  225. this.groupBox4.Controls.Add(this.label1);
  226. this.groupBox4.Location = new System.Drawing.Point(13, 368);
  227. this.groupBox4.Name = "groupBox4";
  228. this.groupBox4.Size = new System.Drawing.Size(526, 64);
  229. this.groupBox4.TabIndex = 4;
  230. this.groupBox4.TabStop = false;
  231. this.groupBox4.Text = "简介";
  232. //
  233. // label1
  234. //
  235. this.label1.AutoSize = true;
  236. this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
  237. this.label1.Location = new System.Drawing.Point(3, 17);
  238. this.label1.Name = "label1";
  239. this.label1.Size = new System.Drawing.Size(41, 12);
  240. this.label1.TabIndex = 0;
  241. this.label1.Text = "label1";
  242. //
  243. // OpenViewDialog
  244. //
  245. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  246. this.ClientSize = new System.Drawing.Size(551, 444);
  247. this.Controls.Add(this.groupBox4);
  248. this.Controls.Add(this.groupBox3);
  249. this.Controls.Add(this.groupBox2);
  250. this.Controls.Add(this.groupBox1);
  251. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  252. this.Name = "OpenViewDialog";
  253. this.Text = "打开视场";
  254. this.Controls.SetChildIndex(this.groupBox1, 0);
  255. this.Controls.SetChildIndex(this.groupBox2, 0);
  256. this.Controls.SetChildIndex(this.groupBox3, 0);
  257. this.Controls.SetChildIndex(this.groupBox4, 0);
  258. this.groupBox1.ResumeLayout(false);
  259. this.groupBox2.ResumeLayout(false);
  260. this.groupBox3.ResumeLayout(false);
  261. this.panel1.ResumeLayout(false);
  262. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  263. this.groupBox4.ResumeLayout(false);
  264. this.groupBox4.PerformLayout();
  265. this.ResumeLayout(false);
  266. }
  267. /// <summary>
  268. /// listView1 ItemSelectionChanged事件
  269. /// </summary>
  270. /// <param name="sender"></param>
  271. /// <param name="e"></param>
  272. private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
  273. {
  274. listView1.FullRowSelect = true;
  275. if (this.listView1.SelectedItems.Count > 0)
  276. {
  277. listView1.SelectedItems[0].SubItems[0].ForeColor = Color.Blue;
  278. //先清除原有格式
  279.                 foreach (ListViewItem item in listView1.Items)
  280. {
  281. item.ForeColor = Color.Black;
  282. }
  283. foreach (ListViewItem item in listView1.Items)
  284. {
  285. item.BackColor = Color.White;
  286. Font f = new Font(Control.DefaultFont, FontStyle.Regular);
  287. item.Font = f;
  288. }
  289.                 //加粗字体
  290.                 Font f2 = new Font(Control.DefaultFont, FontStyle.Bold);
  291. listView1.SelectedItems[0].SubItems[0].Font = f2;
  292.                 //设置选中行背景颜色
  293.                 listView1.SelectedItems[0].BackColor = Color.LightBlue;
  294. listView1.SelectedItems[0].Selected = true;
  295. //赋值当前选中索引
  296. this.index = e.ItemIndex;
  297. //处理UI
  298. this.label1.Text = " " + list.Find(a => a.id == (int)(listView1.SelectedItems[0].Tag)).view_descrption;
  299. //获得model
  300. this.viewListModel = XmlSerializeHelper.DESerializer<ViewListModel>(list.Find(a => a.id == (int)(listView1.SelectedItems[0].Tag)).view_xml);
  301. //绘制右侧预览
  302. this.pictureBox1.Image = this.panel1_Paint(viewListModel);
  303. }
  304. }
  305. /// <summary>
  306. /// 绘制视场到图片
  307. /// </summary>
  308. /// <returns></returns>
  309. private Bitmap panel1_Paint(ViewListModel viewListModel)
  310. {
  311. Region a = null;
  312. for (int i = 0; i < viewListModel.Views.Count; i++)
  313. {
  314. if (viewListModel.Views[i].Type != null)
  315. {
  316. GraphicsPath path = new GraphicsPath();
  317. DrawToolType type = (DrawToolType)Enum.Parse(typeof(DrawToolType), viewListModel.Views[i].Type);
  318. if (type == DrawToolType.ViewOval||type == DrawToolType.ViewCircle)
  319. {
  320. path.AddClosedCurve(viewListModel.Views[i].Points.ToArray());
  321. }
  322. else
  323. {
  324. path.AddPolygon(viewListModel.Views[i].Points.ToArray());
  325. }
  326. if (a == null)
  327. {
  328. a = new Region(path);
  329. }
  330. else
  331. {
  332. if ((CombineMode)Enum.Parse(typeof(CombineMode), viewListModel.Views[i].CombineMode) == CombineMode.Union)
  333. a.Union(path);
  334. else
  335. a.Exclude(path);
  336. }
  337. }
  338. }
  339. int width = (int)viewListModel.RectangleFW;
  340. int height = (int)viewListModel.RectangleFH;
  341. Rectangle rect = new Rectangle(0, 0, width, height);
  342. Bitmap dstBitmap = new Bitmap(width, height);
  343. BitmapData dstBmData = dstBitmap.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
  344. IntPtr dstScan = dstBmData.Scan0;
  345. unsafe
  346. {
  347. byte* dstP = (byte*)(void*)dstScan;
  348. int dstOffset = dstBmData.Stride - width * 4;
  349. for (int y = 0; y < height; y++)
  350. {
  351. for (int x = 0; x < width; x++, dstP += 4)
  352. {
  353. if (a.IsVisible(new Point(x + (int)(viewListModel.RectangleFX), y + (int)(viewListModel.RectangleFY))))
  354. {
  355. dstP[0] = 255;
  356. dstP[1] = 255;
  357. dstP[2] = 255;
  358. dstP[3] = 255;
  359. }
  360. else
  361. {
  362. dstP[0] = 0;
  363. dstP[1] = 0;
  364. dstP[2] = 0;
  365. dstP[3] = 255;
  366. }
  367. }
  368. dstP += dstOffset;
  369. }
  370. }
  371. dstBitmap.UnlockBits(dstBmData);
  372. return dstBitmap;
  373. }
  374. /// <summary>
  375. /// 应用全部
  376. /// </summary>
  377. /// <param name="sender"></param>
  378. /// <param name="e"></param>
  379. private void button1_Click(object sender, EventArgs e)
  380. {
  381. if (viewListModel != null && viewListModel.Views.Count > 0
  382. && this.appWorkspace.DocumentWorkspaces != null
  383. && this.appWorkspace.DocumentWorkspaces.Length > 0)
  384. {
  385. foreach (DocumentWorkspace dw in this.appWorkspace.DocumentWorkspaces)
  386. {
  387. for (int i = 0; i < viewListModel.Views.Count; i++)
  388. {
  389. DrawToolType type = (DrawToolType)Enum.Parse(typeof(DrawToolType), viewListModel.Views[i].Type);
  390. ViewBase line = null;
  391. switch (type)
  392. {
  393. case DrawToolType.ViewOval:
  394. line = new ViewOval(viewListModel.Views[i].Points);
  395. break;
  396. case DrawToolType.ViewCircle:
  397. line = new ViewCircle(viewListModel.Views[i].Points);
  398. break;
  399. case DrawToolType.ViewRectangle:
  400. line = new ViewRectangle(viewListModel.Views[i].Points);
  401. break;
  402. case DrawToolType.ViewTriangle:
  403. line = new ViewTriangle(viewListModel.Views[i].Points);
  404. break;
  405. case DrawToolType.ViewSquare:
  406. line = new ViewSquare(viewListModel.Views[i].Points);
  407. break;
  408. case DrawToolType.ViewRectangleEx:
  409. line = new ViewRectangleEx(viewListModel.Views[i].Points);
  410. break;
  411. case DrawToolType.ViewPolygon:
  412. line = new ViewPolygon(viewListModel.Views[i].Points);
  413. break;
  414. case DrawToolType.ViewTriangleEx:
  415. line = new ViewTriangleEx(viewListModel.Views[i].Points);
  416. break;
  417. }
  418. if (line != null)
  419. {
  420. line.ISurfaceBox = dw;
  421. line.combineMode = (CombineMode)Enum.Parse(typeof(CombineMode), viewListModel.Views[i].CombineMode);
  422. line.Selected = true;
  423. dw.AddGraphicsFromForm(line);
  424. }
  425. }
  426. }
  427. }
  428. }
  429. /// <summary>
  430. /// 删除记录
  431. /// </summary>
  432. /// <param name="sender"></param>
  433. /// <param name="e"></param>
  434. private void button2_Click(object sender, EventArgs e)
  435. {
  436. if (this.listView1.SelectedItems != null && this.listView1.SelectedItems.Count > 0)
  437. {
  438. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletethefie.text") + "?", PdnResources.GetString("Menu.ensure.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  439. if (dr == DialogResult.OK)
  440. {
  441. int id = (int)(this.listView1.SelectedItems[0].Tag);
  442. if (id > 0)
  443. {
  444. //删除数据库文件
  445. mic_view_infos_BLL.Del(id);
  446. InitViewData();
  447. }
  448. }
  449. }
  450. }
  451. /// <summary>
  452. /// 打开记录
  453. /// </summary>
  454. /// <param name="sender"></param>
  455. /// <param name="e"></param>
  456. private void button3_Click(object sender, EventArgs e)
  457. {
  458. //将所有的视场反向还原到surface中
  459. if (viewListModel != null && viewListModel.Views.Count > 0 && this.appWorkspace.ActiveDocumentWorkspace != null
  460. && this.appWorkspace.ActiveDocumentWorkspace.CompositionSurface != null
  461. && this.appWorkspace.ActiveDocumentWorkspace.GraphicsList != null)
  462. {
  463. for (int i = 0; i < viewListModel.Views.Count; i++)
  464. {
  465. DrawToolType type = (DrawToolType)Enum.Parse(typeof(DrawToolType), viewListModel.Views[i].Type);
  466. ViewBase line = null;
  467. switch (type)
  468. {
  469. case DrawToolType.ViewOval:
  470. line = new ViewOval(viewListModel.Views[i].Points);
  471. break;
  472. case DrawToolType.ViewCircle:
  473. line = new ViewCircle(viewListModel.Views[i].Points);
  474. break;
  475. case DrawToolType.ViewRectangle:
  476. line = new ViewRectangle(viewListModel.Views[i].Points);
  477. break;
  478. case DrawToolType.ViewRectangleEx:
  479. line = new ViewRectangleEx(viewListModel.Views[i].Points);
  480. break;
  481. case DrawToolType.ViewTriangle:
  482. line = new ViewTriangle(viewListModel.Views[i].Points);
  483. break;
  484. case DrawToolType.ViewSquare:
  485. line = new ViewSquare(viewListModel.Views[i].Points);
  486. break;
  487. case DrawToolType.ViewPolygon:
  488. line = new ViewPolygon(viewListModel.Views[i].Points);
  489. break;
  490. case DrawToolType.ViewTriangleEx:
  491. line = new ViewTriangleEx(viewListModel.Views[i].Points);
  492. break;
  493. }
  494. if (line != null)
  495. {
  496. line.ISurfaceBox = this.appWorkspace.ActiveDocumentWorkspace;
  497. line.combineMode = (CombineMode)Enum.Parse(typeof(CombineMode), viewListModel.Views[i].CombineMode);
  498. line.Selected = true;
  499. this.appWorkspace.ActiveDocumentWorkspace.AddGraphicsFromForm(line);
  500. }
  501. }
  502. }
  503. }
  504. /// <summary>
  505. /// 重命名
  506. /// </summary>
  507. /// <param name="sender"></param>
  508. /// <param name="e"></param>
  509. private void button4_Click(object sender, EventArgs e)
  510. {
  511. if (this.listView1.SelectedItems != null && this.listView1.SelectedItems.Count > 0)
  512. {
  513. createNameDialog = new EditViewDialog(this);
  514. createNameDialog.Text = PdnResources.GetString("Menu.Rename.text");
  515. createNameDialog.textBox1.Text = list[this.index].view_name;
  516. createNameDialog.richTextBox1.Text = list[this.index].view_descrption;
  517. createNameDialog.StartPosition = FormStartPosition.CenterParent;
  518. createNameDialog.ShowDialog();
  519. }
  520. }
  521. /// <summary>
  522. /// 另存为弹窗 确定保存
  523. /// </summary>
  524. /// <param name="name"></param>
  525. public override void GetCreateName(string name, string desc)
  526. {
  527. mic_view_infos model = list[this.index];
  528. mic_view_infos query = list.Find(a => a.view_name.Equals(name));
  529. if (query != null)
  530. {
  531. if (model.id != query.id)
  532. {
  533. MessageBox.Show(PdnResources.GetString("Menu.viewnamerepeated,pleaserename.text"));
  534. return;
  535. }
  536. }
  537. model.view_name = name;
  538. model.view_descrption = desc;
  539. mic_view_infos_BLL.Update(model);
  540. createNameDialog.Close();
  541. InitViewData();
  542. }
  543. }
  544. }