OpenTween.TweenMain.SetApiStatusLabel C# (CSharp) Method

SetApiStatusLabel() private method

private SetApiStatusLabel ( string endpointName = null ) : void
endpointName string
return void
        private void SetApiStatusLabel(string endpointName = null)
        {
            if (_curTab == null)
            {
                this.toolStripApiGauge.ApiEndpoint = null;
            }
            else
            {
                var tabType = _statuses.Tabs[_curTab.Text].TabType;

                if (endpointName == null)
                {
                    // 表示中のタブに応じて更新
                    switch (tabType)
                    {
                        case MyCommon.TabUsageType.Home:
                        case MyCommon.TabUsageType.UserDefined:
                            endpointName = "/statuses/home_timeline";
                            break;

                        case MyCommon.TabUsageType.Mentions:
                            endpointName = "/statuses/mentions_timeline";
                            break;

                        case MyCommon.TabUsageType.Favorites:
                            endpointName = "/favorites/list";
                            break;

                        case MyCommon.TabUsageType.DirectMessage:
                            endpointName = "/direct_messages";
                            break;

                        case MyCommon.TabUsageType.UserTimeline:
                            endpointName = "/statuses/user_timeline";
                            break;

                        case MyCommon.TabUsageType.Lists:
                            endpointName = "/lists/statuses";
                            break;

                        case MyCommon.TabUsageType.PublicSearch:
                            endpointName = "/search/tweets";
                            break;

                        case MyCommon.TabUsageType.Related:
                            endpointName = "/statuses/show/:id";
                            break;

                        default:
                            break;
                    }

                    this.toolStripApiGauge.ApiEndpoint = endpointName;
                }
                else
                {
                    // 表示中のタブに関連する endpoint であれば更新
                    var update = false;

                    switch (endpointName)
                    {
                        case "/statuses/home_timeline":
                            update = tabType == MyCommon.TabUsageType.Home ||
                                     tabType == MyCommon.TabUsageType.UserDefined;
                            break;

                        case "/statuses/mentions_timeline":
                            update = tabType == MyCommon.TabUsageType.Mentions;
                            break;

                        case "/favorites/list":
                            update = tabType == MyCommon.TabUsageType.Favorites;
                            break;

                        case "/direct_messages:":
                            update = tabType == MyCommon.TabUsageType.DirectMessage;
                            break;

                        case "/statuses/user_timeline":
                            update = tabType == MyCommon.TabUsageType.UserTimeline;
                            break;

                        case "/lists/statuses":
                            update = tabType == MyCommon.TabUsageType.Lists;
                            break;

                        case "/search/tweets":
                            update = tabType == MyCommon.TabUsageType.PublicSearch;
                            break;

                        case "/statuses/show/:id":
                            update = tabType == MyCommon.TabUsageType.Related;
                            break;

                        default:
                            break;
                    }

                    if (update)
                    {
                        this.toolStripApiGauge.ApiEndpoint = endpointName;
                    }
                }
            }
        }
TweenMain