private void OnError() { _plcAccessor.ReadMask(_dbNumber, 0, 6, out _error); if (_error) { ErrorEvent?.BeginInvoke(this, null, null, null); MyEventAggregator.Inst.GetEvent <CmmErrorEvent>().Publish(new CmmErrorStatus() { CmmNo = 1, Error = true }); } }
/// <summary> /// 引发 Error 事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void OnError(object sender, Exception e) { ErrorEvent?.BeginInvoke(sender, e, null, null); }