public void GetAllDataAsync(ShowTimelineIndexType showTimelineIndexType, bool manualRefresh) { if (InvokeRequired) { Invoke(new MethodInvoker( delegate { GetAllDataAsync(showTimelineIndexType, manualRefresh); } )); } else { s_logger.Info("GetAllDataAsync.showTimelineIndexType:" + showTimelineIndexType + ", manualRefresh:" + manualRefresh); m_showTimelineIndexType = showTimelineIndexType; m_manualRefresh = manualRefresh; Cursor = Cursors.WaitCursor; postsArea.updateRefreshUI(false); if (!bgWorkerGetAllData.IsBusy) { bgWorkerGetAllData.RunWorkerAsync(); } } }
private void ShowAllTimeline(ShowTimelineIndexType showTimelineIndexType) { if (InvokeRequired) { Invoke(new MethodInvoker( delegate { ShowAllTimeline(showTimelineIndexType); } )); } else { if (!m_manualRefresh) { PrefetchImages(); } List <Post> _posts = RT.CurrentGroupPosts; setCalendarBoldedDates(_posts); postsArea.ShowPostInforPanel(false); leftArea.SetUI(true); int _index = RT.GetMyTimelinePosition(showTimelineIndexType); s_logger.Info("ShowAllTimeline: showTimelineIndexType=" + showTimelineIndexType + ", TimelineIndex=" + _index); lock (postsArea.PostsList) { postsArea.PostsList.SetPosts(_posts, _index, m_manualRefresh); } } }
public int GetMyTimelinePosition(ShowTimelineIndexType showTimelineIndexType) { string _id = ""; switch (showTimelineIndexType) { case ShowTimelineIndexType.Newest: _id = ""; break; case ShowTimelineIndexType.LocalLastRead: _id = CurrentGroupLocalLastReadID; break; case ShowTimelineIndexType.GlobalLastRead: _id = CurrentGroupLastReadID; break; case ShowTimelineIndexType.Global_Local_LastRead_Compare: _id = GetMyReadPositionID(); break; } if (_id != string.Empty) { for (int i = 0; i < CurrentGroupPosts.Count; i++) { if (CurrentGroupPosts[i].post_id == _id) { return(i); } } } return(0); }