Пример #1
0
        public void SetStats(PublicSummoner summoner, PlayerLifetimeStats stats)
        {
            if (summoner == null || stats == null)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new Action <PublicSummoner, PlayerLifetimeStats>(SetStats), summoner, stats);
                return;
            }

            SetLevel(summoner.SummonerLevel);
            RemoveAll(p => (p.Tag as string) == "Stats");

            foreach (var stat in stats.PlayerStatSummaries.PlayerStatSummarySet)
            {
                if (!stat.PlayerStatSummaryType.Contains("RankedSolo5x5"))
                {
                    continue;
                }
                var sc = new StatsControl {
                    Dock = DockStyle.Fill, Tag = "Stats"
                };
                sc.SetStatSummary(stat);

                var tab = new TabPage(MinifyStatType(stat.PlayerStatSummaryType))
                {
                    BackColor = this.BackColor,
                    Tag       = "Stats"
                };
                tab.Controls.Add(sc);
                AddTab(tab);
            }
        }
Пример #2
0
        public void SetStats(PublicSummoner summoner, PlayerLifetimeStats stats)
        {
            if (summoner == null || stats == null)
                return;

            if (InvokeRequired)
            {
                Invoke(new Action<PublicSummoner, PlayerLifetimeStats>(SetStats), summoner, stats);
                return;
            }

            SetLevel(summoner.SummonerLevel);
            RemoveAll(p => (p.Tag as string) == "Stats");

            foreach (var stat in stats.PlayerStatSummaries.PlayerStatSummarySet)
            {
                if (!stat.PlayerStatSummaryType.Contains("RankedSolo5x5"))
                    continue;
                var sc = new StatsControl { Dock = DockStyle.Fill, Tag = "Stats" };
                sc.SetStatSummary(stat);

                var tab = new TabPage(MinifyStatType(stat.PlayerStatSummaryType))
                {
                    BackColor = this.BackColor,
                    Tag = "Stats"
                };
                tab.Controls.Add(sc);
                AddTab(tab);
            }
        }