frmCustomLabel.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using LYFZ.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. namespace LYFZ.Software.MainBusiness.NewCameraControlBook
  7. {
  8. public class frmCustomLabel : LYFZ.Software.NewCameraControlBook.frmCustomLabel
  9. {
  10. public frmCustomLabel() {
  11. this.buttonEx1.Click += ButtonEx1_Click;
  12. this.buttonEx2.Click += ButtonEx2_Click;
  13. this.Shown += FrmCustomLabel_Shown;
  14. }
  15. private void FrmCustomLabel_Shown(object sender, EventArgs e)
  16. {
  17. this.txtInfo.Text =String.Join(System.Environment.NewLine, labelData.GetCustomLabelList(_AddCameraType));
  18. }
  19. private void ButtonEx2_Click(object sender, EventArgs e)
  20. {
  21. this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  22. }
  23. private void ButtonEx1_Click(object sender, EventArgs e)
  24. {
  25. labelData.AddCustomLabel(_AddCameraType, this.txtInfo.Text.Trim());
  26. this.DialogResult = System.Windows.Forms.DialogResult.OK;
  27. }
  28. CameraType _AddCameraType = CameraType.拍照客人;
  29. CustomLabelData labelData = new CustomLabelData();
  30. public CustomLabelData LabelData { get => labelData; set => labelData = value; }
  31. public CameraType AddCameraType { get => _AddCameraType; set => _AddCameraType = value; }
  32. }
  33. }