Exemplo n.º 1
0
        protected override void KeyDown(object sender, KeyboardKeyEventArgs e)
        {
            TableWidget table = (TableWidget)widgets[view.tableIndex];

            if (e.Key == Key.Enter)
            {
                string curServer = Get(view.hashIndex) ?? "";
                if (table.Count >= 1 && curServer == "")
                {
                    widgets[view.hashIndex].Text = table.Get(0).Hash;
                    ConnectToServer(0, 0);
                }
                else if (curServer != "" &&
                         (selectedWidget == null || selectedWidget == widgets[view.tableIndex]))
                {
                    ConnectToServer(0, 0);
                }
            }
            else if (e.Key == Key.Up)
            {
                table.SetSelected(table.SelectedIndex - 1);
                table.NeedRedraw();
            }
            else if (e.Key == Key.Down)
            {
                table.SetSelected(table.SelectedIndex + 1);
                table.NeedRedraw();
            }
            else
            {
                base.KeyDown(sender, e);
            }
        }
        protected override void RedrawLastInput()
        {
            base.RedrawLastInput();
            if (curInput != widgets[view.hashIndex])
            {
                return;
            }
            TableWidget table = (TableWidget)widgets[view.tableIndex];

            table.SetSelected(widgets[view.hashIndex].Text);
            MarkPendingRedraw();
        }
Exemplo n.º 3
0
        void FilterList()
        {
            if (curInput != widgets[view.searchIndex])
            {
                return;
            }

            TableWidget table = (TableWidget)widgets[view.tableIndex];

            table.FilterEntries(curInput.Text);
            table.SetSelected(table.SelectedHash);
            MarkPendingRedraw();
        }
Exemplo n.º 4
0
        void CheckFetchStatus()
        {
            if (!game.Session.Done)
            {
                return;
            }
            fetchingList = false;

            view.RefreshText = game.Session.Exception == null ? "Refresh" : "&cFailed";
            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();
        }
Exemplo n.º 5
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();
        }