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));
        }
示例#3
0
 private void regionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (!justLoaded)
     {
         RefreshStatus((CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex));
     }
 }
示例#4
0
 void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (canChangeSettings)
     {
         AppConstants.preferredRegion = (CreepScore.Region)AppConstants.GetCreepScoreRegion(comboBox.SelectedIndex);
     }
 }
示例#5
0
        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));
        }
示例#6
0
        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);
                }
            }
        }
示例#7
0
 private void refreshStatusButton_Click(object sender, RoutedEventArgs e)
 {
     RefreshStatus((CreepScore.Region)AppConstants.GetCreepScoreRegion(regionComboBox.SelectedIndex));
 }