private void regionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!justLaunched) { AppConstants.preferredRegion = (CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex); } }
async Task SaveRegionSetting() { AppConstants.preferredRegion = (CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex); StorageFile regionFile = await AppConstants.TryCreateFile("Region.json", localFolder); await AppConstants.OverwriteFile(regionFile, UrlConstants.GetRegion(AppConstants.preferredRegion)); }
private void regionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!justLoaded) { RefreshStatus((CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex)); } }
void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (canChangeSettings) { AppConstants.preferredRegion = (CreepScore.Region)AppConstants.GetCreepScoreRegion(comboBox.SelectedIndex); } }
public async Task SaveRegionSetting() { StorageFolder localFolder = ApplicationData.Current.LocalFolder; AppConstants.preferredRegion = (CreepScore.Region)AppConstants.GetCreepScoreRegion(comboBox.SelectedIndex); StorageFile regionFile = await AppConstants.TryCreateFile("Region.json", localFolder); await AppConstants.OverwriteFile(regionFile, UrlConstants.GetRegion(AppConstants.preferredRegion)); }
private async void summonerSearchBox_KeyDown(object sender, KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { if (summonerSearchBox.Text == "") { return; } summonerSearchBox.IsEnabled = false; searchingForSummonerRing.IsActive = true; //heroName.Focus(FocusState.Programmatic); string summonerName = summonerSearchBox.Text; CreepScore.Region region = (CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex); Summoner summoner = await AppConstants.creepScore.RetrieveSummoner(region, summonerName); if (summoner == null) { searchingForSummonerRing.IsActive = false; if (AppConstants.creepScore.ErrorString == "404") { errorTextBlock.Text = "Cannot find summoner"; errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible; } else if (AppConstants.creepScore.ErrorString == "401") { errorTextBlock.Text = "Unauthorized"; errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible; } else if (AppConstants.creepScore.ErrorString == "429") { errorTextBlock.Text = "Rate limit exceeded"; errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible; } else if (AppConstants.creepScore.ErrorString == "500") { errorTextBlock.Text = "Internal Riot server error"; errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible; } else if (AppConstants.creepScore.ErrorString == "503") { errorTextBlock.Text = "Riot service unavalible"; errorTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible; } summonerSearchBox.IsEnabled = true; } else { searchingForSummonerRing.IsActive = false; List <object> parameters = new List <object>(); parameters.Add(summoner); Frame.Navigate(typeof(SummonerPage), parameters); } } }
private void refreshStatusButton_Click(object sender, RoutedEventArgs e) { RefreshStatus((CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex)); }