Example #1
0
        public void RedrawContestInfo(bool highlightDivePanel = false)
        {
            if (this.listViewLeaderboard.InvokeRequired)
            {
                RedrawDelegate d = new RedrawDelegate(RedrawContestInfo);
                this.Invoke(d, highlightDivePanel);
                return;
            }

            UpdateLeaderboard();
            UpdateJudgeList();
            UpdateJudgeScores();
            PrintEventStatus();

            tabsRounds.SelectedIndex = CurrentRoundIndex;
            _pagePanels[tabsRounds.SelectedIndex].BringToFront();

            if (highlightDivePanel)
            {
                HighlightCurrentDive();
            }
        }
Example #2
0
        public void RedrawContestInfo(bool highlightDivePanel = false)
        {
            if (this.listViewLeaderboard.InvokeRequired)
            {
                RedrawDelegate d = new RedrawDelegate(RedrawContestInfo);
                this.Invoke(d, highlightDivePanel);
                return;
            }

            UpdateLeaderboard();
            UpdateJudgeList();
            UpdateJudgeScores();
            PrintEventStatus();

            tabsRounds.SelectedIndex = CurrentRoundIndex;
            _pagePanels[tabsRounds.SelectedIndex].BringToFront();

            if (highlightDivePanel)
                HighlightCurrentDive();
        }
        public void Redraw()
        {
            if (InvokeRequired)
            {
                var d = new RedrawDelegate(Redraw);
                Invoke(d, new object[] { });
            }
            else
            {
                _isRedrawing = true;

                TN3270.WaitTillKeyboardUnlocked(2000);
                Text = TN3270.CurrentScreenXML.Dump();

                SelectAll();
                SelectionColor = Color.Lime;

                if (TN3270.CurrentScreenXML.Fields == null)
                {
                    SelectionProtected = false;
                    SelectionColor     = Color.Lime;
                    DeselectAll();

                    for (int i = 0; i < Text.Length; i++)
                    {
                        Select(i, 1);
                        if (SelectedText != " " && SelectedText != "\n")
                        {
                            SelectionColor = Color.Lime;
                        }
                    }
                    return;
                }

                SelectionProtected = true;
                foreach (Open3270.TN3270.XMLScreenField field in TN3270.CurrentScreenXML.Fields)
                {
                    if (string.IsNullOrEmpty(field.Text))
                    {
                        continue;
                    }

                    Application.DoEvents();
                    _textColor = Color.Lime;
                    if (field.Attributes.FieldType == "High" && field.Attributes.Protected)
                    {
                        _textColor = Color.White;
                    }
                    else if (field.Attributes.FieldType == "High")
                    {
                        _textColor = Color.Red;
                    }
                    else if (field.Attributes.Protected)
                    {
                        _textColor = Color.RoyalBlue;
                    }

                    Select((field.Location.top * 84 + 172) + field.Location.left + 3, field.Location.length);
                    SelectionProtected = false;
                    SelectionColor     = _textColor;

                    if (_textColor == Color.White || _textColor == Color.RoyalBlue)
                    {
                        SelectionProtected = true;
                    }
                }
                _isRedrawing = false;

                Select((TN3270.CursorY * 84 + 172) + TN3270.CursorX + 3, 0);
            }
        }