public void Update(SummonerLeaguesDTO result)
 {
     MyLeagues = result;
     foreach (LeagueListDTO leagues in MyLeagues.SummonerLeagues)
     {
         if (leagues.Queue == "RANKED_SOLO_5x5")
             SelectedRank = leagues.RequestorsRank;
     }
     Queue = "RANKED_SOLO_5x5";
     RenderLeague();
 }
        public void Update(SummonerLeaguesDTO result)
        {
            myLeagues = result;
            foreach (
                var leagues in myLeagues.SummonerLeagues.Where(leagues => leagues.Queue == "RANKED_SOLO_5x5"))
            {
                selectedRank = leagues.RequestorsRank;
            }

            queue = "RANKED_SOLO_5x5";
            RenderLeague();
        }
        private void GotLeaguesForPlayer(SummonerLeaguesDTO result)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                if (result.SummonerLeagues != null && result.SummonerLeagues.Count > 0)
                {
                    LeagueHeader.Visibility = Visibility.Visible;

                    var overview = LeaguesContainer.Content as Leagues;
                    if (overview != null)
                        overview.Update(result);
                }
                else
                    LeagueHeader.Visibility = Visibility.Collapsed;
            }));
        }
        private void GotLeaguesForPlayer(SummonerLeaguesDTO result)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                string CurrentLP = "";
                string CurrentTier = "";
                bool InPromo = false;
                if (result.SummonerLeagues != null && result.SummonerLeagues.Count > 0)
                {
                    foreach (LeagueListDTO leagues in result.SummonerLeagues)
                    {
                        if (leagues.Queue == "RANKED_SOLO_5x5")
                        {
                            Client.Tier = leagues.RequestorsRank;
                            Client.TierName = leagues.Tier;
                            Client.LeagueName = leagues.Name;
                            CurrentTier = leagues.Tier + " " + leagues.RequestorsRank;
                            List<LeagueItemDTO> players = leagues.Entries.OrderBy(o => o.LeaguePoints).Where(item => item.Rank == leagues.RequestorsRank).ToList();
                            foreach (LeagueItemDTO player in players)
                            {
                                if (player.PlayerOrTeamName == Client.LoginPacket.AllSummonerData.Summoner.Name)
                                {
                                    string Series = "";
                                    if (player.MiniSeries != null)
                                    {
                                        Series = player.MiniSeries.Progress.Replace('N', '-');
                                        InPromo = true;
                                    }
                                    CurrentLP = (player.LeaguePoints == 100 ? Series : Convert.ToString(player.LeaguePoints));
                                }
                            }
                        }
                    }
                }
                else
                {
                    PlayerProgressBar.Value = 100;
                    PlayerProgressLabel.Content = "Level 30";
                    PlayerCurrentProgressLabel.Content = "";
                    PlayerAimProgressLabel.Content = "";
                    return;
                }

                PlayerProgressLabel.Content = CurrentTier;
                if (InPromo)
                {
                    PlayerCurrentProgressLabel.Content = CurrentLP.Replace('N', '-');
                    PlayerProgressBar.Value = 100;
                }
                else
                {
                    PlayerCurrentProgressLabel.Content = CurrentLP + "LP";
                    PlayerProgressBar.Value = Convert.ToInt32(CurrentLP);
                }
            }));
        }