LabelName.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 IntelligentControlForsx.Service.WindturbineControl.Domain;
  11. namespace IntelligentControlForsx.MyControls.windturbine
  12. {
  13. public partial class LabelName : UserControl
  14. {
  15. public LabelName()
  16. {
  17. InitializeComponent();
  18. }
  19. private string lblName;
  20. public string LblName
  21. {
  22. set
  23. {
  24. lblName = value;
  25. lblNameString.Text = value;
  26. }
  27. get { return lblName; }
  28. }
  29. private bool warningValue;
  30. public bool WarningValue
  31. {
  32. set
  33. {
  34. if (value)
  35. {
  36. lblNameString.ForeColor = Color.FromArgb(255, 128, 0);
  37. }
  38. else
  39. {
  40. lblNameString.ForeColor = Color.FromArgb(255, 255, 255);
  41. }
  42. warningValue = value;
  43. }
  44. get { return warningValue; }
  45. }
  46. public event EventHandler MyClick;
  47. private void lblWindturbineName_Click(object sender, EventArgs e)
  48. {
  49. if (!this.DesignMode)
  50. {
  51. Label lable = (Label)sender;
  52. MyClick(this.Name, e);
  53. }
  54. }
  55. }
  56. }