U_Image.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. using System;
  2. using System.ComponentModel;
  3. using System.Diagnostics;
  4. using System.Drawing;
  5. using System.Drawing.Design;
  6. using System.Reflection;
  7. using System.Windows.Forms;
  8. using Microsoft.VisualBasic;
  9. using Microsoft.VisualBasic.CompilerServices;
  10. namespace Dongke.IBOSS.PRD.Framework.Controls
  11. {
  12. [DesignerGenerated]
  13. [Browsable(false)]
  14. [EditorBrowsable(EditorBrowsableState.Never)]
  15. [ToolboxItem(false)]
  16. public class U_Image : UserControl, ICustomTypeDescriptor, IControl
  17. {
  18. private class XpropDescriptor : PropertyDescriptor
  19. {
  20. private string theProp;
  21. private U_Image mycc;
  22. public override Type ComponentType => GetType();
  23. public override bool IsReadOnly => false;
  24. public override Type PropertyType
  25. {
  26. get
  27. {
  28. switch (theProp.ToLower())
  29. {
  30. case "isprint":
  31. return mycc.IsPrint.GetType();
  32. case "x":
  33. return mycc.X.GetType();
  34. case "y":
  35. return mycc.Y.GetType();
  36. case "ewidth":
  37. return mycc.EWidth.GetType();
  38. case "eheight":
  39. return mycc.EHeight.GetType();
  40. case "linewidth":
  41. return mycc.LineWidth.GetType();
  42. case "linecolor":
  43. return mycc.LineColor.GetType();
  44. case "leftborder":
  45. return mycc.LeftBorder.GetType();
  46. case "rightborder":
  47. return mycc.RightBorder.GetType();
  48. case "topborder":
  49. return mycc.TopBorder.GetType();
  50. case "bottomborder":
  51. return mycc.BottomBorder.GetType();
  52. case "img":
  53. return typeof(Image);
  54. case "picturevar":
  55. return mycc.PictureVar.GetType();
  56. case "layerout":
  57. return mycc.LayerOut.GetType();
  58. case "valign":
  59. return mycc.Valign.GetType();
  60. case "halign":
  61. return mycc.Halign.GetType();
  62. default:
  63. Interaction.MsgBox("Property过程编程错误,属性名称[" + theProp + "]未找到");
  64. return null;
  65. }
  66. }
  67. }
  68. public XpropDescriptor(U_Image cc, string prop, Attribute[] attrs)
  69. : base(prop, attrs)
  70. {
  71. theProp = cc.GetPropertyEnglishName(prop);
  72. mycc = cc;
  73. }
  74. public override bool CanResetValue(object component)
  75. {
  76. return false;
  77. }
  78. public override object GetValue(object component)
  79. {
  80. switch (theProp.ToLower())
  81. {
  82. case "isprint":
  83. return mycc.IsPrint;
  84. case "x":
  85. return mycc.X;
  86. case "y":
  87. return mycc.Y;
  88. case "ewidth":
  89. return mycc.EWidth;
  90. case "eheight":
  91. return mycc.EHeight;
  92. case "linewidth":
  93. return mycc.LineWidth;
  94. case "linecolor":
  95. return mycc.LineColor;
  96. case "leftborder":
  97. return mycc.LeftBorder;
  98. case "rightborder":
  99. return mycc.RightBorder;
  100. case "topborder":
  101. return mycc.TopBorder;
  102. case "bottomborder":
  103. return mycc.BottomBorder;
  104. case "img":
  105. return mycc.Img;
  106. case "picturevar":
  107. return mycc.PictureVar;
  108. case "layerout":
  109. return mycc.LayerOut;
  110. case "valign":
  111. return mycc.Valign;
  112. case "halign":
  113. return mycc.Halign;
  114. default:
  115. Interaction.MsgBox("GetValue过程编程错误,属性名称[" + theProp + "]未找到");
  116. return null;
  117. }
  118. }
  119. public override void ResetValue(object component)
  120. {
  121. }
  122. public override void SetValue(object component, object value)
  123. {
  124. switch (theProp.ToLower())
  125. {
  126. case "isprint":
  127. mycc.IsPrint = Conversions.ToBoolean(value);
  128. break;
  129. case "x":
  130. mycc.X = Conversions.ToSingle(value);
  131. break;
  132. case "y":
  133. mycc.Y = Conversions.ToSingle(value);
  134. break;
  135. case "ewidth":
  136. mycc.EWidth = Conversions.ToSingle(value);
  137. break;
  138. case "eheight":
  139. mycc.EHeight = Conversions.ToSingle(value);
  140. break;
  141. case "linewidth":
  142. mycc.LineWidth = Conversions.ToSingle(value);
  143. break;
  144. case "linecolor":
  145. {
  146. Color black = Color.Black;
  147. mycc.LineColor = ((value != null) ? ((Color)value) : black);
  148. break;
  149. }
  150. case "leftborder":
  151. mycc.LeftBorder = Conversions.ToBoolean(value);
  152. break;
  153. case "rightborder":
  154. mycc.RightBorder = Conversions.ToBoolean(value);
  155. break;
  156. case "topborder":
  157. mycc.TopBorder = Conversions.ToBoolean(value);
  158. break;
  159. case "bottomborder":
  160. mycc.BottomBorder = Conversions.ToBoolean(value);
  161. break;
  162. case "img":
  163. mycc.Img = (Image)value;
  164. break;
  165. case "picturevar":
  166. mycc.PictureVar = Conversions.ToString(value);
  167. break;
  168. case "layerout":
  169. mycc.LayerOut = (DataGridViewImageCellLayout)Conversions.ToInteger(value);
  170. break;
  171. case "valign":
  172. mycc.Valign = (StringAlignment)Conversions.ToInteger(value);
  173. break;
  174. case "halign":
  175. mycc.Halign = (StringAlignment)Conversions.ToInteger(value);
  176. break;
  177. default:
  178. Interaction.MsgBox("SetValue过程编程错误,属性名称[" + theProp + "]未找到");
  179. break;
  180. }
  181. }
  182. public override bool ShouldSerializeValue(object component)
  183. {
  184. return false;
  185. }
  186. }
  187. private IContainer components;
  188. private float MYX;
  189. private float MYY;
  190. private bool theisprint;
  191. private float thelinewidth;
  192. private Color thelinecolor;
  193. private bool theleftborder;
  194. private bool thetopborder;
  195. private bool therightborder;
  196. private bool thebottomborder;
  197. private string thepicturevar;
  198. private StringAlignment thevalign;
  199. private StringAlignment thehalign;
  200. private DataGridViewImageCellLayout thelayout;
  201. private string[,] DefineProperty;
  202. private float GetX => MYX;
  203. private float GetY => MYY;
  204. [Category("布局")]
  205. [Description("图片垂直对齐方式,打印时有效")]
  206. public StringAlignment Valign
  207. {
  208. get
  209. {
  210. return thevalign;
  211. }
  212. set
  213. {
  214. thevalign = value;
  215. }
  216. }
  217. [Category("布局")]
  218. [Description("图片水平对齐方式,打印时有效")]
  219. public StringAlignment Halign
  220. {
  221. get
  222. {
  223. return thehalign;
  224. }
  225. set
  226. {
  227. thehalign = value;
  228. }
  229. }
  230. [Description("图片缩放设置")]
  231. [Category("布局")]
  232. public DataGridViewImageCellLayout LayerOut
  233. {
  234. get
  235. {
  236. return thelayout;
  237. }
  238. set
  239. {
  240. thelayout = value;
  241. switch (value)
  242. {
  243. case DataGridViewImageCellLayout.Stretch:
  244. BackgroundImageLayout = ImageLayout.Stretch;
  245. return;
  246. case DataGridViewImageCellLayout.Zoom:
  247. BackgroundImageLayout = ImageLayout.Zoom;
  248. return;
  249. }
  250. if ((Valign == StringAlignment.Center) & (Halign == StringAlignment.Center))
  251. {
  252. BackgroundImageLayout = ImageLayout.Center;
  253. }
  254. else
  255. {
  256. BackgroundImageLayout = ImageLayout.None;
  257. }
  258. }
  259. }
  260. [Description("以套打模式打印或预览时,是否打印该控件的内容")]
  261. [Category("行为")]
  262. public bool IsPrint
  263. {
  264. get
  265. {
  266. return theisprint;
  267. }
  268. set
  269. {
  270. theisprint = value;
  271. }
  272. }
  273. [Category("布局")]
  274. [Description("控件所处的X位置,以毫米为计量单位")]
  275. public float X
  276. {
  277. get
  278. {
  279. return ConvertToMM(base.Left, isX: true);
  280. }
  281. set
  282. {
  283. base.Left = checked((int)Math.Round(ConvertFromMM(value, isx: true)));
  284. }
  285. }
  286. [Category("布局")]
  287. [Description("控件所处的Y位置,以毫米为计量单位")]
  288. public float Y
  289. {
  290. get
  291. {
  292. return ConvertToMM(base.Top, isX: false);
  293. }
  294. set
  295. {
  296. base.Top = checked((int)Math.Round(ConvertFromMM(value, isx: false)));
  297. }
  298. }
  299. [Category("布局")]
  300. [Description("控件的宽度,以毫米为计量单位")]
  301. public float EWidth
  302. {
  303. get
  304. {
  305. return ConvertToMM(base.Width, isX: true);
  306. }
  307. set
  308. {
  309. base.Width = checked((int)Math.Round(ConvertFromMM(value, isx: true)));
  310. }
  311. }
  312. [Description("控件的高度,以毫米为计量单位")]
  313. [Category("布局")]
  314. public float EHeight
  315. {
  316. get
  317. {
  318. return ConvertToMM(base.Height, isX: false);
  319. }
  320. set
  321. {
  322. base.Height = checked((int)Math.Round(ConvertFromMM(value, isx: false)));
  323. }
  324. }
  325. [Category("外观")]
  326. [Description("边线宽度,不是直线的长度,以毫米为计量单位, 必须大于等于0")]
  327. public float LineWidth
  328. {
  329. get
  330. {
  331. return thelinewidth;
  332. }
  333. set
  334. {
  335. if (value < 0f)
  336. {
  337. value = 0f;
  338. }
  339. thelinewidth = value;
  340. Invalidate();
  341. }
  342. }
  343. [Category("外观")]
  344. [Description("线条颜色")]
  345. public Color LineColor
  346. {
  347. get
  348. {
  349. return thelinecolor;
  350. }
  351. set
  352. {
  353. thelinecolor = value;
  354. Invalidate();
  355. }
  356. }
  357. [Description("是否显示左边框")]
  358. [Category("边框")]
  359. public bool LeftBorder
  360. {
  361. get
  362. {
  363. return theleftborder;
  364. }
  365. set
  366. {
  367. theleftborder = value;
  368. Invalidate();
  369. }
  370. }
  371. [Description("是否显示右边框")]
  372. [Category("边框")]
  373. public bool RightBorder
  374. {
  375. get
  376. {
  377. return therightborder;
  378. }
  379. set
  380. {
  381. therightborder = value;
  382. Invalidate();
  383. }
  384. }
  385. [Description("是否显示上边框")]
  386. [Category("边框")]
  387. public bool TopBorder
  388. {
  389. get
  390. {
  391. return thetopborder;
  392. }
  393. set
  394. {
  395. thetopborder = value;
  396. Invalidate();
  397. }
  398. }
  399. [Description("是否显示下边框")]
  400. [Category("边框")]
  401. public bool BottomBorder
  402. {
  403. get
  404. {
  405. return thebottomborder;
  406. }
  407. set
  408. {
  409. thebottomborder = value;
  410. Invalidate();
  411. }
  412. }
  413. [Category("外观")]
  414. [Description("要显示的图片(注意,如果设置了PictureVar属性且是合法的图片,则会忽略此属性而使用PictureVar属性指定的图片)")]
  415. public Image Img
  416. {
  417. get
  418. {
  419. return BackgroundImage;
  420. }
  421. set
  422. {
  423. BackgroundImage = value;
  424. Invalidate();
  425. }
  426. }
  427. [Category("外观")]
  428. [Description("要显示的图片自定义变量(可以是图片路径字符串变量,也可以是以字符串形式表示的图片的自定义变量)")]
  429. [Editor(typeof(U_Editor), typeof(UITypeEditor))]
  430. public string PictureVar
  431. {
  432. get
  433. {
  434. return thepicturevar;
  435. }
  436. set
  437. {
  438. thepicturevar = value;
  439. }
  440. }
  441. [DebuggerNonUserCode]
  442. protected override void Dispose(bool disposing)
  443. {
  444. try
  445. {
  446. if (disposing && components != null)
  447. {
  448. components.Dispose();
  449. }
  450. }
  451. finally
  452. {
  453. base.Dispose(disposing);
  454. }
  455. }
  456. [System.Diagnostics.DebuggerStepThrough]
  457. private void InitializeComponent()
  458. {
  459. base.SuspendLayout();
  460. System.Drawing.SizeF sizeF = new System.Drawing.SizeF(6f, 12f);
  461. base.AutoScaleDimensions = sizeF;
  462. base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  463. this.BackColor = System.Drawing.Color.White;
  464. this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
  465. this.DoubleBuffered = true;
  466. System.Windows.Forms.Padding margin = new System.Windows.Forms.Padding(0);
  467. base.Margin = margin;
  468. base.Name = "U_Image";
  469. System.Drawing.Size size = new System.Drawing.Size(169, 37);
  470. base.Size = size;
  471. base.ResumeLayout(false);
  472. }
  473. public float ConvertToMM(float tt, bool isX)
  474. {
  475. if (isX)
  476. {
  477. return (float)Math.Round((double)(tt / MYX) * 2.54 * 10.0, 2);
  478. }
  479. return (float)Math.Round((double)(tt / MYY) * 2.54 * 10.0, 2);
  480. }
  481. public float ConvertFromMM(float tt, bool isx)
  482. {
  483. if (isx)
  484. {
  485. return (float)((double)(tt * MYX) / 2.54 / 10.0);
  486. }
  487. return (float)((double)(tt * MYY) / 2.54 / 10.0);
  488. }
  489. public string GetPropertyEnglishName(string cname)
  490. {
  491. bool flag = false;
  492. int num = 0;
  493. checked
  494. {
  495. int num2 = DefineProperty.GetLength(0) - 1;
  496. int i;
  497. for (i = num; i <= num2; i++)
  498. {
  499. if (Operators.CompareString(DefineProperty[i, 1].ToUpper(), cname.ToUpper(), TextCompare: false) == 0)
  500. {
  501. flag = true;
  502. break;
  503. }
  504. }
  505. if (flag)
  506. {
  507. return DefineProperty[i, 0];
  508. }
  509. return cname;
  510. }
  511. }
  512. public string GetPropertyChineseName(string ename)
  513. {
  514. bool flag = false;
  515. int num = 0;
  516. checked
  517. {
  518. int num2 = DefineProperty.GetLength(0) - 1;
  519. int i;
  520. for (i = num; i <= num2; i++)
  521. {
  522. if (Operators.CompareString(DefineProperty[i, 0].ToUpper(), ename.ToUpper(), TextCompare: false) == 0)
  523. {
  524. flag = true;
  525. break;
  526. }
  527. }
  528. if (flag)
  529. {
  530. return DefineProperty[i, 1];
  531. }
  532. return ename;
  533. }
  534. }
  535. protected override void OnPaint(PaintEventArgs e)
  536. {
  537. base.OnPaint(e);
  538. float num = ConvertFromMM(LineWidth, isx: true);
  539. Pen pen = new Pen(LineColor, num);
  540. if (LeftBorder)
  541. {
  542. e.Graphics.DrawLine(pen, num / 2f, num / 2f, num / 2f, (float)base.Height - num - 1f);
  543. }
  544. if (RightBorder)
  545. {
  546. e.Graphics.DrawLine(pen, (float)base.Width - num - 1f, num / 2f, (float)base.Width - num - 1f, (float)base.Height - num - 1f);
  547. }
  548. if (TopBorder)
  549. {
  550. e.Graphics.DrawLine(pen, num / 2f, num / 2f, (float)base.Width - num - 1f, num / 2f);
  551. }
  552. if (BottomBorder)
  553. {
  554. e.Graphics.DrawLine(pen, num / 2f, (float)base.Height - num - 1f, (float)base.Width - num - 1f, (float)base.Height - num - 1f);
  555. }
  556. }
  557. protected override void OnResize(EventArgs e)
  558. {
  559. base.OnResize(e);
  560. Invalidate();
  561. }
  562. public U_Image()
  563. {
  564. base.Disposed += U_Image_Disposed;
  565. theisprint = true;
  566. thelinewidth = 0f;
  567. thelinecolor = Color.Black;
  568. theleftborder = true;
  569. thetopborder = true;
  570. therightborder = true;
  571. thebottomborder = true;
  572. thepicturevar = "";
  573. thevalign = StringAlignment.Center;
  574. thehalign = StringAlignment.Center;
  575. thelayout = DataGridViewImageCellLayout.Stretch;
  576. DefineProperty = new string[3, 2];
  577. InitializeComponent();
  578. MYX = CreateGraphics().DpiX;
  579. MYY = CreateGraphics().DpiY;
  580. DefineProperty = new string[16, 2];
  581. DefineProperty[0, 0] = "IsPrint";
  582. DefineProperty[0, 1] = "是否套打";
  583. DefineProperty[1, 0] = "X";
  584. DefineProperty[1, 1] = "X位置";
  585. DefineProperty[2, 0] = "Y";
  586. DefineProperty[2, 1] = "Y位置";
  587. DefineProperty[3, 0] = "EWidth";
  588. DefineProperty[3, 1] = "宽度";
  589. DefineProperty[4, 0] = "LineWidth";
  590. DefineProperty[4, 1] = "线宽";
  591. DefineProperty[5, 0] = "LineColor";
  592. DefineProperty[5, 1] = "线条颜色";
  593. DefineProperty[6, 0] = "EHeight";
  594. DefineProperty[6, 1] = "高度";
  595. DefineProperty[7, 0] = "LeftBorder";
  596. DefineProperty[7, 1] = "左边框";
  597. DefineProperty[8, 0] = "RightBorder";
  598. DefineProperty[8, 1] = "右边框";
  599. DefineProperty[9, 0] = "TopBorder";
  600. DefineProperty[9, 1] = "上边框";
  601. DefineProperty[10, 0] = "BottomBorder";
  602. DefineProperty[10, 1] = "下边框";
  603. DefineProperty[11, 0] = "Img";
  604. DefineProperty[11, 1] = "图片内容";
  605. DefineProperty[12, 0] = "PictureVar";
  606. DefineProperty[12, 1] = "图片变量";
  607. DefineProperty[13, 0] = "LayerOut";
  608. DefineProperty[13, 1] = "图片布局";
  609. DefineProperty[14, 0] = "Valign";
  610. DefineProperty[14, 1] = "垂直对齐";
  611. DefineProperty[15, 0] = "Halign";
  612. DefineProperty[15, 1] = "水平对齐";
  613. }
  614. public AttributeCollection GetAttributes()
  615. {
  616. return TypeDescriptor.GetAttributes(this, noCustomTypeDesc: true);
  617. }
  618. public string GetClassName()
  619. {
  620. return TypeDescriptor.GetClassName(this, noCustomTypeDesc: true);
  621. }
  622. public string GetComponentName()
  623. {
  624. return TypeDescriptor.GetClassName(this, noCustomTypeDesc: true);
  625. }
  626. public TypeConverter GetConverter()
  627. {
  628. return TypeDescriptor.GetConverter(this, noCustomTypeDesc: true);
  629. }
  630. public EventDescriptor GetDefaultEvent()
  631. {
  632. return TypeDescriptor.GetDefaultEvent(this, noCustomTypeDesc: true);
  633. }
  634. public PropertyDescriptor GetDefaultProperty()
  635. {
  636. return TypeDescriptor.GetDefaultProperty(this, noCustomTypeDesc: true);
  637. }
  638. public object GetEditor(Type editorBaseType)
  639. {
  640. return TypeDescriptor.GetEditor(this, editorBaseType, noCustomTypeDesc: true);
  641. }
  642. public EventDescriptorCollection GetEvents()
  643. {
  644. return TypeDescriptor.GetEvents(this, noCustomTypeDesc: true);
  645. }
  646. public EventDescriptorCollection GetEvents(Attribute[] attributes)
  647. {
  648. return TypeDescriptor.GetEvents(this, attributes, noCustomTypeDesc: true);
  649. }
  650. public PropertyDescriptorCollection GetProperties()
  651. {
  652. return TypeDescriptor.GetProperties(this, noCustomTypeDesc: true);
  653. }
  654. public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
  655. {
  656. checked
  657. {
  658. PropertyDescriptor[] array = new PropertyDescriptor[DefineProperty.GetLength(0) - 1 + 1];
  659. int num = 0;
  660. int num2 = array.Length - 1;
  661. for (int i = num; i <= num2; i++)
  662. {
  663. Type type = GetType();
  664. PropertyInfo[] properties = type.GetProperties();
  665. PropertyInfo[] array2 = properties;
  666. foreach (PropertyInfo propertyInfo in array2)
  667. {
  668. if (Operators.CompareString(propertyInfo.Name.ToUpper(), DefineProperty[i, 0].ToUpper(), TextCompare: false) == 0)
  669. {
  670. attributes = Attribute.GetCustomAttributes(propertyInfo);
  671. break;
  672. }
  673. }
  674. array[i] = new XpropDescriptor(this, DefineProperty[i, 1], attributes);
  675. }
  676. return new PropertyDescriptorCollection(array);
  677. }
  678. }
  679. public object GetPropertyOwner(PropertyDescriptor pd)
  680. {
  681. return this;
  682. }
  683. private void U_Image_Disposed(object sender, EventArgs e)
  684. {
  685. try
  686. {
  687. DefineProperty = null;
  688. }
  689. catch (Exception projectError)
  690. {
  691. ProjectData.SetProjectError(projectError);
  692. ProjectData.ClearProjectError();
  693. }
  694. }
  695. public void RestoreFromString(string ss)
  696. {
  697. string[] array = Strings.Split(ss, mbsjmodule.G_MB_Spetator_Proper);
  698. if (Operators.CompareString(array[0], "1", TextCompare: false) == 0)
  699. {
  700. IsPrint = true;
  701. }
  702. else
  703. {
  704. IsPrint = false;
  705. }
  706. X = Conversions.ToSingle(array[1]);
  707. Y = Conversions.ToSingle(array[2]);
  708. EWidth = Conversions.ToSingle(array[3]);
  709. LineWidth = Conversions.ToSingle(array[4]);
  710. LineColor = Module1.ConvertStringToColor(array[5]);
  711. EHeight = Conversions.ToSingle(array[6]);
  712. LeftBorder = Conversions.ToBoolean(Interaction.IIf(Operators.CompareString(array[7], "1", TextCompare: false) == 0, true, false));
  713. RightBorder = Conversions.ToBoolean(Interaction.IIf(Operators.CompareString(array[8], "1", TextCompare: false) == 0, true, false));
  714. TopBorder = Conversions.ToBoolean(Interaction.IIf(Operators.CompareString(array[9], "1", TextCompare: false) == 0, true, false));
  715. BottomBorder = Conversions.ToBoolean(Interaction.IIf(Operators.CompareString(array[10], "1", TextCompare: false) == 0, true, false));
  716. Img = Module1.ConvertStringToImage(array[11]);
  717. if (array.Length >= 13)
  718. {
  719. PictureVar = array[12];
  720. }
  721. if (array.Length >= 16)
  722. {
  723. LayerOut = (DataGridViewImageCellLayout)Conversions.ToInteger(array[13]);
  724. Halign = (StringAlignment)Conversions.ToInteger(array[14]);
  725. Valign = (StringAlignment)Conversions.ToInteger(array[15]);
  726. }
  727. }
  728. public string SaveAsString()
  729. {
  730. string text = ((!IsPrint) ? "0" : "1");
  731. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(X);
  732. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(Y);
  733. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(EWidth);
  734. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(LineWidth);
  735. text = text + mbsjmodule.G_MB_Spetator_Proper + Module1.ConvertColorToString(LineColor);
  736. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(EHeight);
  737. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(Interaction.IIf(LeftBorder, "1", "0"));
  738. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(Interaction.IIf(RightBorder, "1", "0"));
  739. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(Interaction.IIf(TopBorder, "1", "0"));
  740. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString(Interaction.IIf(BottomBorder, "1", "0"));
  741. text = text + mbsjmodule.G_MB_Spetator_Proper + Module1.ConvertImageToString(Img);
  742. text = text + mbsjmodule.G_MB_Spetator_Proper + PictureVar;
  743. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString((int)LayerOut);
  744. text = text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString((int)Halign);
  745. return text + mbsjmodule.G_MB_Spetator_Proper + Conversions.ToString((int)Valign);
  746. }
  747. }
  748. }