Exemplo n.º 1
0
    /// <summary>
    /// 派发观察者消息
    /// </summary>
    /// <param name="target"></param>
    /// <param name="noticeName"></param>
    /// <param name="notice"></param>
    public static void Dispatch(this INotificationSender target, int noticeName, INoticeBase <int> notice = default)
    {
        bool defaultNotice = notice == default;

        if (defaultNotice)
        {
            notice = Pooling <Notice> .From();
        }
        else
        {
        }

        notice.SetNoticeName(noticeName);
        notice.NotifcationSender = target;

        NotificatonsInt.Instance.Notificater.Dispatch(notice);

        if (defaultNotice)
        {
            Pooling <Notice> .To(notice as Notice);
        }
        else
        {
        }
    }
Exemplo n.º 2
0
 public static void Dispatch(this INotificationSender target, int noticeName, INoticeBase <int> notice)
 {
     notice.SetNoticeName(noticeName);
     notice.NotifcationSender = target;
     ShipDockApp.Instance.Notificater.Dispatch(notice);
 }