/// <summary> /// /// </summary> /// <param name="tip"></param> private static void CancelRaise(EventAttribute tip) { if (!tip.IsEnabled) { return; } var raiseName = EventUtil.GetRaise(tip.Name); EventPortal.Cancel(raiseName); }
/// <summary> /// 订阅触发 /// </summary> /// <param name="tip"></param> private static void SubscribeRaise(EventAttribute tip) { if (!tip.IsEnabled) { return; } var raiseName = EventUtil.GetRaise(tip.Name); //作为事件的提供方,我们订阅了触发事件,这样当外界发布了“触发事件”后,这里就可以收到消息并且执行事件 EventPortal.Subscribe(raiseName, RaiseEventHandler.Instance); }
private static void RaiseRemoteEvent(EventEntry entry, dynamic identity, DTObject args) { entry.Status = EventStatus.Raising; //先订阅触发事件的返回结果的事件 SubscribeRemoteEventResult(entry.EventName, entry.EventId); //再发布“触发事件”的事件 var raiseEventName = EventUtil.GetRaise(entry.EventName); EventPortal.Publish(raiseEventName, entry.GetRemotable(identity, args)); //触发远程事件就是发布一个“触发事件”的事件 ,订阅者会收到消息后会执行触发操作 TimeoutManager.Start(new EventKey(entry.EventId, entry.EventName)); }