SignalTowerItem.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Venus_Core
  8. {
  9. public class SignalTowerItem:INotifyPropertyChanged
  10. {
  11. public event PropertyChangedEventHandler PropertyChanged;
  12. public void InvokePropertyChanged(string propertyName)
  13. {
  14. if (PropertyChanged != null)
  15. {
  16. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  17. }
  18. }
  19. private string _name;
  20. public string Name
  21. {
  22. get { return _name; }
  23. set { _name = value; InvokePropertyChanged("Name"); }
  24. }
  25. private bool _isRed;
  26. public bool IsRed
  27. {
  28. get { return _isRed; }
  29. set
  30. {
  31. _isRed = value;
  32. if (value) IsRedBlinking = false; InvokePropertyChanged("IsRed");
  33. }
  34. }
  35. private bool _isRedBlinking;
  36. public bool IsRedBlinking
  37. {
  38. get { return _isRedBlinking; }
  39. set
  40. {
  41. _isRedBlinking = value;
  42. if (value) IsRed = false; InvokePropertyChanged("IsRedBlinking");
  43. }
  44. }
  45. private bool _isGreen;
  46. public bool IsGreen
  47. {
  48. get { return _isGreen; }
  49. set
  50. {
  51. _isGreen = value;
  52. if (value) IsGreenBlinking = false; InvokePropertyChanged("IsGreen");
  53. }
  54. }
  55. private bool _isGreenBlinking;
  56. public bool IsGreenBlinking
  57. {
  58. get { return _isGreenBlinking; }
  59. set
  60. {
  61. _isGreenBlinking = value;
  62. if (value) IsGreen = false; InvokePropertyChanged("IsGreenBlinking");
  63. }
  64. }
  65. private bool _isBlue;
  66. public bool IsBlue
  67. {
  68. get { return _isBlue; }
  69. set
  70. {
  71. _isBlue = value;
  72. if (value) IsBlueBlinking = false; InvokePropertyChanged("IsBlue");
  73. }
  74. }
  75. private bool _isBlueBlinking;
  76. public bool IsBlueBlinking
  77. {
  78. get { return _isBlueBlinking; }
  79. set
  80. {
  81. _isBlueBlinking = value;
  82. if (value) IsBlue = false; InvokePropertyChanged("IsBlueBlinking");
  83. }
  84. }
  85. private bool _isYellow;
  86. public bool IsYellow
  87. {
  88. get { return _isYellow; }
  89. set
  90. {
  91. _isYellow = value;
  92. if (value) IsYellowBlinking = false; InvokePropertyChanged("IsYellow");
  93. }
  94. }
  95. private bool _isYellowBlinking;
  96. public bool IsYellowBlinking
  97. {
  98. get { return _isYellowBlinking; }
  99. set
  100. {
  101. _isYellowBlinking = value;
  102. if (value) IsYellow = false; InvokePropertyChanged("IsYellowBlinking");
  103. }
  104. }
  105. private bool _isBuzzer;
  106. public bool IsBuzzer
  107. {
  108. get { return _isBuzzer; }
  109. set
  110. {
  111. _isBuzzer = value;
  112. if (value) IsBuzzerBlinking = false; InvokePropertyChanged("IsBuzzer");
  113. }
  114. }
  115. private bool _isBuzzerBlinking;
  116. public bool IsBuzzerBlinking
  117. {
  118. get { return _isBuzzerBlinking; }
  119. set
  120. {
  121. _isBuzzerBlinking = value;
  122. if (value) IsBuzzer = false; InvokePropertyChanged("IsBuzzerBlinking");
  123. }
  124. }
  125. }
  126. }