UControl_CutHole.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using MeasureData;
  11. namespace HOZProject
  12. {
  13. public partial class UControl_CutHole : UserControl
  14. {
  15. #region 成员变量
  16. private string cutHoleName;
  17. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  18. private string cutHoleCode;
  19. public string CutHoleCode { get => cutHoleCode; set => cutHoleCode = value; }
  20. private int cutHoleState;
  21. public int CutHoleState { get => cutHoleState; set => cutHoleState = value; }
  22. private FormHOZMain formHOZMain;
  23. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  24. private UControl_ParaInfo uControl_ParaInfo;
  25. public UControl_ParaInfo UControl_ParaInfo { get => uControl_ParaInfo; set => uControl_ParaInfo = value; }
  26. #endregion
  27. public UControl_CutHole(FormHOZMain formHOZ)
  28. {
  29. InitializeComponent();
  30. FormHOZMainObject = formHOZ;
  31. }
  32. private void UContrl_CutHole_Load(object sender, EventArgs e)
  33. {
  34. btnCutHole.Text = CutHoleName;
  35. }
  36. private void tsShowProcess_Click(object sender, EventArgs e)
  37. {
  38. }
  39. private void tsShowParaInfo_Click(object sender, EventArgs e)
  40. {
  41. //显示处理信息
  42. ShowParaControl(UControl_ParaInfo.Name);
  43. if (UControl_ParaInfo.lblShowState.Text=="进行中")
  44. {
  45. FormHOZMain.ControlFlicker = true;
  46. }else
  47. {
  48. FormHOZMain.ControlFlicker = false;
  49. }
  50. //List<CutHole> ListCutHole = FormHOZMainObject.m_MeasureFile.ListCutHole;
  51. ////重新获取切孔列表信息
  52. //ListCutHole = FormHOZMainObject.m_MeasureFile.ListCutHole;
  53. ////创建切孔列表信息
  54. //FormHOZMainObject.CreateCutHoleList(ListCutHole);
  55. //if (FormHOZMainObject.plPrarInfo.Visible)
  56. //{
  57. // FormHOZMainObject.plPrarInfo.Visible = false;
  58. //}
  59. //else
  60. //{
  61. // FormHOZMainObject.plPrarInfo.Visible = true;
  62. //}
  63. FormHOZMainObject.plPrarInfo.Visible = true;
  64. }
  65. /// <summary>
  66. /// 向主界面中的属性层中,添加切孔信息用户控件
  67. /// </summary>
  68. /// <param name="uControl_ParaInfo"></param>
  69. private void AddParaControl(UControl_ParaInfo uControl_ParaInfo)
  70. {
  71. bool isExist = false;
  72. if (FormHOZMainObject.plPrarInfo.Controls.Count == 0)
  73. {
  74. FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo);
  75. isExist = true;
  76. }
  77. else
  78. {
  79. foreach (Control item in FormHOZMainObject.plPrarInfo.Controls)
  80. {
  81. if (item is UserControl)
  82. {
  83. if (item.Name == uControl_ParaInfo.Name)
  84. {
  85. isExist = true;
  86. break;
  87. }
  88. }
  89. }
  90. }
  91. if (!isExist)
  92. {
  93. FormHOZMainObject.plPrarInfo.Controls.Add(uControl_ParaInfo);
  94. }
  95. }
  96. private void ShowParaControl(string cutHoleName)
  97. {
  98. foreach (Control item in FormHOZMainObject.plPrarInfo.Controls)
  99. {
  100. if (item is UserControl)
  101. {
  102. if (item.Name == cutHoleName)
  103. {
  104. item.Visible = true;
  105. FormHOZMainObject.plPrarInfo.Height = item.Height;
  106. }
  107. else
  108. {
  109. item.Visible = false;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }