コード例 #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();
            }));
        }
コード例 #2
0
ファイル: HackList.xaml.cs プロジェクト: wan-qy/CenaPlus
 public void OnFragmentNavigation(FirstFloor.ModernUI.Windows.Navigation.FragmentNavigationEventArgs e)
 {
     contest_id = int.Parse(e.Fragment);
     var ids = App.Server.GetHackList(contest_id);
     HackListBoxItems.Clear();
     foreach (var hid in ids)
     {
         var hack = App.Server.GetHackGeneral(hid);
         var item = new HackListBoxItem()
         {
             ProblemTitle = hack.ProblemTitle,
             HackerUserNickName = hack.HackerUserNickName,
             DefenderUserNickName = hack.DefenderUserNickName,
             HackID = hack.HackID,
             RecordID = hack.RecordID,
             Status = hack.Status,
             Time = hack.Time
         };
         HackListBoxItems.Add(item);
     }
     lstHack.Items.Refresh();
 }
コード例 #3
0
        public void OnFragmentNavigation(FirstFloor.ModernUI.Windows.Navigation.FragmentNavigationEventArgs e)
        {
            contest_id = int.Parse(e.Fragment);
            var ids = App.Server.GetHackList(contest_id);

            HackListBoxItems.Clear();
            foreach (var hid in ids)
            {
                var hack = App.Server.GetHackGeneral(hid);
                var item = new HackListBoxItem()
                {
                    ProblemTitle         = hack.ProblemTitle,
                    HackerUserNickName   = hack.HackerUserNickName,
                    DefenderUserNickName = hack.DefenderUserNickName,
                    HackID   = hack.HackID,
                    RecordID = hack.RecordID,
                    Status   = hack.Status,
                    Time     = hack.Time
                };
                HackListBoxItems.Add(item);
            }
            lstHack.Items.Refresh();
        }
コード例 #4
0
ファイル: HackList.xaml.cs プロジェクト: wan-qy/CenaPlus
 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();
     }));
 }