OpenTween.TweenMain.GoSamePostToAnotherTab C# (CSharp) Method

GoSamePostToAnotherTab() private method

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

            var tab = this._statuses.Tabs[this._curTab.Text];

            // Directタブは対象外(見つかるはずがない)
            if (tab.TabType == MyCommon.TabUsageType.DirectMessage)
                return;

            var selectedIndex = this._curList.SelectedIndices[0];
            var selectedStatusId = tab.GetStatusIdAt(selectedIndex);

            int fIdx, toIdx, stp;

            if (left)
            {
                // 左のタブへ
                if (ListTab.SelectedIndex == 0)
                {
                    return;
                }
                else
                {
                    fIdx = ListTab.SelectedIndex - 1;
                }
                toIdx = -1;
                stp = -1;
            }
            else
            {
                // 右のタブへ
                if (ListTab.SelectedIndex == ListTab.TabCount - 1)
                {
                    return;
                }
                else
                {
                    fIdx = ListTab.SelectedIndex + 1;
                }
                toIdx = ListTab.TabCount;
                stp = 1;
            }

            for (int tabidx = fIdx; tabidx != toIdx; tabidx += stp)
            {
                var targetTab = this._statuses.Tabs[this.ListTab.TabPages[tabidx].Text];

                // Directタブは対象外
                if (targetTab.TabType == MyCommon.TabUsageType.DirectMessage)
                    continue;

                var foundIndex = targetTab.IndexOf(selectedStatusId);
                if (foundIndex != -1)
                {
                    ListTab.SelectedIndex = tabidx;
                    SelectListItem(_curList, foundIndex);
                    _curList.EnsureVisible(foundIndex);
                    return;
                }
            }
        }
TweenMain