OpenTween.TweenMain.GoRelPost C# (CSharp) Method

GoRelPost() private method

private GoRelPost ( bool forward ) : void
forward bool
return void
        private void GoRelPost(bool forward)
        {
            if (this._curList.SelectedIndices.Count == 0)
                return;

            var tab = this._statuses.Tabs[this._curTab.Text];
            var selectedIndex = this._curList.SelectedIndices[0];

            int fIdx, toIdx, stp;

            if (forward)
            {
                fIdx = selectedIndex + 1;
                if (fIdx > tab.AllCount - 1) return;
                toIdx = tab.AllCount;
                stp = 1;
            }
            else
            {
                fIdx = selectedIndex - 1;
                if (fIdx < 0) return;
                toIdx = -1;
                stp = -1;
            }

            if (!_anchorFlag)
            {
                if (_curPost == null) return;
                _anchorPost = _curPost;
                _anchorFlag = true;
            }
            else
            {
                if (_anchorPost == null) return;
            }

            for (int idx = fIdx; idx != toIdx; idx += stp)
            {
                var post = tab[idx];
                if (post.ScreenName == _anchorPost.ScreenName ||
                    post.RetweetedBy == _anchorPost.ScreenName ||
                    post.ScreenName == _anchorPost.RetweetedBy ||
                    (!string.IsNullOrEmpty(post.RetweetedBy) && post.RetweetedBy == _anchorPost.RetweetedBy) ||
                    _anchorPost.ReplyToList.Contains(post.ScreenName.ToLowerInvariant()) ||
                    _anchorPost.ReplyToList.Contains(post.RetweetedBy.ToLowerInvariant()) ||
                    post.ReplyToList.Contains(_anchorPost.ScreenName.ToLowerInvariant()) ||
                    post.ReplyToList.Contains(_anchorPost.RetweetedBy.ToLowerInvariant()))
                {
                    SelectListItem(_curList, idx);
                    _curList.EnsureVisible(idx);
                    break;
                }
            }
        }
TweenMain