private void d3HeroControl_Click(object sender, EventArgs e) { var control = sender as D3HeroControl; if (control == null) { return; } if (activeHeroControl != null) { activeHeroControl.IsHighlighted = false; } control.IsHighlighted = true; var container = (D3HeroContainer)control.Tag; var hero = FetchHero(container.HeroSummary, container.BattleTag, container.Host); Task.Run(() => { ShowHero(hero); activeHeroControl = control; }); }
private void ShowCareer(Career career, BattleTag battleTag, Host host) { if (career == null) { return; } guiHeroesPanel.Controls.Clear(); foreach (var hero in career.Heroes) { var control = new D3HeroControl(hero); control.Click += d3HeroControl_Click; control.Tag = new D3HeroContainer(hero, battleTag, host); guiHeroesPanel.Controls.Add(control); } guiRefreshCareer.Visible = true; }