private void SubscribeHandler(object sender, SubscribeEventArgs e) { var recipient = (IDirectRecipient)ForumNotifySource.Instance.GetRecipientsProvider().GetRecipient(e.UserID.ToString()); if (recipient != null) { ForumNotifySource.Instance.GetSubscriptionProvider().Subscribe(e.NotifyAction, e.ObjectID, recipient); } }
void GetSubscriptionStateHandler(object sender, SubscribeEventArgs e) { var recipient = (IDirectRecipient)ForumNotifySource.Instance.GetRecipientsProvider().GetRecipient(e.UserID.ToString()); if (recipient == null) { return; } ISubscriptionProvider subscriptionProvider = ForumNotifySource.Instance.GetSubscriptionProvider(); List <string> objectIDs = new List <string>(subscriptionProvider.GetSubscriptions(e.NotifyAction, recipient)); if (e.ObjectID == null && objectIDs.Count == 1 && objectIDs[0] == null) { _view.IsSubscribe = true; return; } _view.IsSubscribe = (objectIDs.Find(id => String.Compare(id, e.ObjectID, true) == 0) != null); }