private void signal_OnSignalChanged(object sender, SignalChangeType change) { if (InvokeRequired) { //handle thread safety SignalChanged d = new SignalChanged(signal_OnSignalChanged); try { if (IsDisposed == false) { Invoke(d, new object[] { sender, change }); } } catch (ObjectDisposedException) { //although it should be not possible, catch it here } } else { Size = CheckSize(Size); if (change == SignalChangeType.SignalGraph) { UpdateDrawing(); } else { UpdateBackground(); } Invalidate(); } }
/// <summary> /// Trigger for the change event /// </summary> private void RaiseChangeEvent(SignalChangeType change) { if (OnSignalChanged != null) { OnSignalChanged(this, change); } }
/// <summary> /// Event handler on signal change /// </summary> /// <param name="sender"></param> /// <param name="change">type of the changes</param> void SignalChangedEventHandler(object sender, SignalChangeType change) { //if (m_IgnoreEvent == false && change == SignalChangeType.SignalGraph) //{ // bool old = m_IgnoreEvent; // m_IgnoreEvent = true; // m_SignalList.ForceConsistency(); // m_IgnoreEvent = old; //} }
private void Signal_OnSignalChanged(object sender, SignalChangeType change) { // handle change in the name of the signal if (change != SignalChangeType.SignalName) { return; } Signal signal = sender as Signal; ChangeSignalText(signal.Name); }
private void SetData(object value, SignalChangeType changeType) { data = value; if (Data != null) { SignalLogItem logItem = new SignalLogItem(this, changeType, Data); Log.Add(logItem); if (Log.Count > 1000) { Log.RemoveAt(0); } ProcessDataChange(); OnDataChange?.Invoke(this, true); } }
public SignalLogItem(Signal raisedSignal, SignalChangeType changeType, object data) : base() { RaisedBySignal = raisedSignal; ChangeType = changeType; LoggedData = data; }