Ejemplo n.º 1
0
        public void Refresh(Entity.HackResult result)
        {
            var hackindex = HackListBoxItems.FindIndex(x => x.HackID == result.HackID);
            var item      = new HackListBoxItem()
            {
                ProblemTitle         = result.ProblemTitle,
                HackerUserNickName   = result.HackerUserNickName,
                DefenderUserNickName = result.DefenderUserNickName,
                HackID   = result.HackID,
                RecordID = result.RecordID,
                Status   = result.Status,
                Time     = result.Time
            };

            Dispatcher.Invoke(new Action(() =>
            {
                if (hackindex == -1)
                {
                    HackListBoxItems.Add(item);
                }
                else
                {
                    HackListBoxItems[hackindex] = item;
                }
                lstHack.Items.Refresh();
            }));
        }
Ejemplo n.º 2
0
        public HackFinishedPush(Entity.HackResult result)
        {
            InitializeComponent();
            tbHackID.Text   = result.HackID.ToString();
            tbHacker.Text   = result.HackerUserNickName;
            tbDefender.Text = result.DefenderUserNickName;
            tbProblem.Text  = result.ProblemTitle;
            tbStatus.Text   = result.Status.ToString();
            tbTime.Text     = result.Time.ToString();
            switch (result.Status)
            {
            case HackStatus.BadData:
            case HackStatus.DatamakerError:
                tbStatus.Foreground = new SolidColorBrush(Colors.Orange);
                break;

            case HackStatus.Failure:
                tbStatus.Foreground = new SolidColorBrush(Colors.Red);
                break;

            case HackStatus.Success:
                tbStatus.Foreground = new SolidColorBrush(Colors.Green);
                break;

            default:
                tbStatus.Foreground = new SolidColorBrush(Colors.SkyBlue);
                break;
            }
        }
Ejemplo n.º 3
0
 public HackPush(Entity.HackResult result)
 {
     InitializeComponent();
     tbStatusID.Text = result.RecordID.ToString();
     tbProblem.Text  = result.ProblemTitle;
     tbHacker.Text   = result.HackerUserNickName;
     tbTime.Text     = result.Time.ToString();
 }