Exemple #1
0
        private void RankListForm_Load(object sender, EventArgs e)
        {
            var data = GetRankListInfo();

            if (data != null)
            {
                var ListItems = new List <ListViewItem>();

                for (int i = 0; i < data.Count; ++i)
                {
                    var item = new ListViewItem()
                    {
                        Text = string.Format("第{0}名", ChnNums[i + 1]),
                    };

                    var span = TimeSpan.FromMilliseconds(data[i].time);
                    var time = string.Format("{0:D2}:{1:D2}:{2:D2} {3:D3}", span.Hours, span.Minutes, span.Seconds, span.Milliseconds);

                    item.SubItems.Add(data[i].name);
                    item.SubItems.Add(time);
                    ListItems.Add(item);
                }

                RankListView.BeginUpdate();
                foreach (var obj in ListItems)
                {
                    RankListView.Items.Add(obj);
                }
                RankListView.EndUpdate();
            }
        }
 public RankListViewMediator(RankListView lobbyPanel) : base(NAME)
 {
     m_viewComponent = lobbyPanel;
 }