コード例 #1
0
        void FetchTick()
        {
            fetchTask.Tick();
            if (!fetchTask.Completed)
            {
                return;
            }

            if (fetchTask.Success)
            {
                game.Servers = fetchTask.Servers;
                game.SetScreen(new ServersScreen(game));
            }
            else
            {
                DisplayWebException(fetchTask.WebEx, "retrieving servers list");
                game.RedrawBackground();
                Resize();
            }

            fetchTask = null;
        }
コード例 #2
0
        void CheckFetchStatus()
        {
            fetchTask.Tick();
            if (!fetchTask.Completed)
            {
                return;
            }

            if (fetchTask.Success)
            {
                game.Servers = fetchTask.Servers;
                FetchFlags(game);
            }

            view.RefreshText = fetchTask.Success ? "Refresh" : "&cFailed";
            fetchTask        = null;
            Resize();

            // needed to ensure 'highlighted server hash' is over right entry after refresh
            TableWidget table = (TableWidget)widgets[view.tableIndex];

            table.SetSelected(widgets[view.hashIndex].Text);
            MarkPendingRedraw();
        }