using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using WisdomClient.data; namespace IntelligentControlForsx.MyControls { public partial class Breaker : UserControl, IPointData { private string tagId; private TsData tagData; private bool? PointValue = null; public Breaker() { InitializeComponent(); } [Browsable(true), Category("Point")] public TsData TagData { get { return tagData; } set { tagData = value; if (tagData != null && tagData.booleanValue.HasValue) { if (PointValue.HasValue) { if (PointValue != tagData.booleanValue.Value) { this.BackColor = tagData.booleanValue.Value ? Color.Red : Color.Green; PointValue = tagData.booleanValue.Value; } } else { this.BackColor = tagData.booleanValue.Value ? Color.Red : Color.Green; PointValue = tagData.booleanValue.Value; } } } } [Browsable(true), Category("Point")] public string TagId { get { return tagId; } set { tagId = value; } } private void Breaker_Load(object sender, EventArgs e) { } } }