コード例 #1
0
        public void GetInfo()
        {
            // get a player from name input
            Summoner = api.GetSummonerByName(Region, Username);

            SummonerLevel        = "Level " + Summoner.SummonerLevel;
            SummonerRevisionDate = Api.Api.FromUnixTime(Summoner.RevisionDate).ToString();

            // get profile icon from static api
            string profileIconUrl = staticApi.GetProfileIconUrl(Summoner.ProfileIconId, Region);

            Uri uri = new Uri(profileIconUrl);

            ProfileIcon = new BitmapImage(uri);

            Leagues = api.GetLeaguePositionById(Region, Summoner.Id);
            string tierIconLocation = "pack://application:,,,/LolApp;component/resources/tier-icons/{0}_{1}.png";

            if (Leagues.Count >= 1)
            {
                QueueType1 = QueueFormat(Leagues[0]);
                Rank1      = RankFormat(Leagues[0]);
                Uri tierUri = new Uri(String.Format(tierIconLocation, Leagues[0].Tier.ToLower(), Leagues[0].Rank.ToLower()));
                TierIcon1 = new BitmapImage(tierUri);
            }
            if (Leagues.Count >= 2)
            {
                QueueType2 = QueueFormat(Leagues[1]);
                Rank2      = RankFormat(Leagues[1]);
                Uri tierUri = new Uri(String.Format(tierIconLocation, Leagues[1].Tier.ToLower(), Leagues[1].Rank.ToLower()));
                TierIcon2 = new BitmapImage(tierUri);
            }
            if (Leagues.Count >= 3)
            {
                QueueType3 = QueueFormat(Leagues[2]);
                Rank3      = RankFormat(Leagues[2]);
                Uri tierUri = new Uri(String.Format(tierIconLocation, Leagues[2].Tier.ToLower(), Leagues[2].Rank.ToLower()));
                TierIcon3 = new BitmapImage(tierUri);
            }
        }