public List <DisplayReply> GetNewReply() { Logger.Debug("Query new replies."); NotificationCount notif = _client.GetNotificationCount(); if (notif.UnreadReplyCount == 0) { Logger.Debug("No reply found."); return(new List <DisplayReply>()); } Logger.Debug(_client.GetReply(notif.UnreadReplyCount).message.Count + " replies found"); return(_client.GetReply(notif.UnreadReplyCount).message); }
void Update() { while (true) { try { if (!Globals.Ribbons.Ribbon.keepUpdateBtn.Checked) { continue; } //Fill home List <DisplayMembership> members = _client.GetJoinedGroup(); this.Dispatcher.Invoke((Action)(() => { _homeItem.Items.Clear(); foreach (var member in members) { MyTreeViewItem item = new MyTreeViewItem(member.DisplayName, true, MessageViewType.Home, new Dictionary <string, object>() { { "GroupID", member.GroupID }, { "UserID", Utils.GetCurrentUserID() } }); _homeItem.Items.Add(item); } })); //Fill topic List <DisplayFavouriteTopic> topics = _client.GetMyFavouriteTopic(); this.Dispatcher.Invoke((Action)(() => { _topicItem.Items.Clear(); foreach (var topic in topics) { MyTreeViewItem item = new MyTreeViewItem( string.Format("{0}({1})", topic.topicName, topic.UnreadMsgCount), true, MessageViewType.Topic, new Dictionary <string, object>() { { "GroupID", topic.GroupID }, { "TopicName", topic.topicName } }); _topicItem.Items.Add(item); } })); //Fill Following List <DisplayUserProfile> followings = _client.GetFollowings(); this.Dispatcher.Invoke((Action)(() => { _followingItem.Items.Clear(); foreach (var user in followings) { MyTreeViewItem item = new MyTreeViewItem( string.Format("{0}({1})", user.DisplayName, user.Userid), true, MessageViewType.User, new Dictionary <string, object>() { { "DisplayName", user.DisplayName }, { "UserID", user.Userid } }); _followingItem.Items.Add(item); } })); //Update Notification count NotificationCount notif = _client.GetNotificationCount(); this.Dispatcher.Invoke((Action)(() => { _homeItem.Header = string.Format("Home({0})", notif.UnreadHomelineMsgCount); _ownItem.Header = string.Format("Own({0})", notif.UnreadOwnerlineMsgCount); _mentionItem.Header = string.Format("Mention({0})", notif.UnreadAtlineMsgCount); })); } catch (Exception e) { MessageBox.Show(e.Message + "\r\n" + e.StackTrace, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } finally { Thread.Sleep(1000 * 120); } } }
public NotificationCount UpdateStatus() { return(_client.GetNotificationCount(Userid)); }