Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
        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);
                }
            }
        }
Beispiel #3
0
        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);
        }