public async void GetSummonerProfile(string region, string riotPath, string summonerProfilePath, string summonerId, string apiKey) { HttpClient httpClient = new HttpClient(); var request = "https://" + region + riotPath + summonerProfilePath + summonerId + "/?api_key=" + apiKey; var response = await httpClient.GetStringAsync(request); var summonerProfile = JsonConvert.DeserializeObject <List <SummonerProfileDTO> >(response); if (summonerProfile.Count == 0) { await DisplayAlert(Constants.SummonerName.ToUpper(), Constants.SummonerName.ToUpper() + " hasn't played in 2020", "Search again"); await Navigation.PushAsync(new MainPage()); return; } else { for (int i = 0; i < summonerProfile.Count; i++) { Constants.SummonerTier = summonerProfile[i].Tier; summonerProfile[i].SummonerLevel = Constants.SummonerLevel; summonerProfile[i].SummonerTierImage = Emblems.EmblemsAccordingToRanks(); } summonerProfileListView.ItemsSource = summonerProfile; } }
public void Add(List <Identifier> idents, string relPath) { var ident = idents.FirstOrDefault(); if (ident == null) { ExtraFiles.Add(relPath); return; } if (ident is SkinIdentifier skinId) { var skinIds = idents.Cast <SkinIdentifier>().ToList(); if (skinIds.Count > 1) { MultiSkinFiles.Add(relPath, skinIds); } else { Skins.Add(relPath, ident as SkinIdentifier); } } else if (ident is PortraitIdentifier) { Portraits.Add(relPath, idents.Cast <PortraitIdentifier>()); } else if (ident is CrosshairIdentifier) { Crosshairs.Add(relPath, idents.Cast <CrosshairIdentifier>()); } else if (ident is WeaponIdentifier) { Weapons.Add(relPath, idents.Cast <WeaponIdentifier>()); } else if (ident is EffectsIdentifier) { Effects.Add(relPath, idents.Cast <EffectsIdentifier>()); } else if (ident is CanopyIdentifier) { Canopies.Add(relPath, idents.Cast <CanopyIdentifier>()); } else if (ident is EmblemIdentifier) { Emblems.Add(relPath, idents.Cast <EmblemIdentifier>()); } else if (ident is CockpitIdentifier) { Cockpits.Add(relPath, idents.Cast <CockpitIdentifier>()); } }