终端一体化运控平台
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

IEventExtends.cs 1.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* ==============================================================================
  2. * 功能描述:
  3. * 创 建 者:张原川
  4. * 创建日期:2016/10/10 16:50:12
  5. * ==============================================================================*/
  6. namespace BPASmartClient.EventBus
  7. {
  8. /// <summary>
  9. ///
  10. /// </summary>
  11. public static class IEventExtends
  12. {
  13. #region Methods - Public
  14. /// <summary>
  15. /// 发布
  16. /// </summary>
  17. /// <typeparam name="TEvent"></typeparam>
  18. /// <param name="message"></param>
  19. public static void Publish<TEvent>(this TEvent message) where TEvent : class, IEvent
  20. {
  21. EventBus.GetInstance().Publish<TEvent>(message);
  22. }
  23. /// <summary>
  24. ///
  25. /// </summary>
  26. /// <typeparam name="TEvent"></typeparam>
  27. /// <param name="message"></param>
  28. /// <param name="eventCallBack"></param>
  29. public static void Publish<TEvent>(this TEvent message, EventBus.EventCallBackHandle eventCallBack) where TEvent : class, IEvent
  30. {
  31. EventBus.GetInstance().Publish<TEvent>(message, eventCallBack);
  32. }
  33. #endregion
  34. }
  35. }