private void ParseStatus(List <Event> events) { NewSystemEventArgs args = new NewSystemEventArgs(); args.systemEvents = events; OnNewSystemEvents(args); }
protected virtual void OnNewSystemEvents(NewSystemEventArgs e) { EventHandler <NewSystemEventArgs> handler = NewSystemEvents; if (handler != null) { handler(this, e); } }
private void OnNewSystemEventGenerated(object sender, NewSystemEventArgs args) { try { this.InvokeWithCatch(() => { this.ShowSysEventLog(args.Value); }, LogUtility.Log); } catch (Exception ex) { LogUtility.Error(ex); } }
/// <summary> /// 当新的系统事件产生时。 /// </summary> private void OnNewSystemEventGenerated(object sender, NewSystemEventArgs args) { try { if (args.Value.Code == 0) { GlobalServices.SEM.AddSysEventLog(args.Value); } else { GlobalServices.SEM.UpdateSysEventLog(args.Value); } } catch (System.Exception ex) { LogUtility.Error(ex); } }
/// <summary> /// 发布 系统事件产生或更新 消息。 /// </summary> public static IMessageResponse PublishNewSystemEventGenerated(NewSystemEventArgs args, object sender = null) { return(SystemEventMessageBus.Publish(SystemEventTopic, args, sender, false)); }