コード例 #1
0
        private void PopulateForm(string gamesXMLFile, string gamesXMLFileName)
        {
            XMLManipulation xmlRead = new XMLManipulation();

            gameList = xmlRead.ReadXmlFile(gamesXMLFile);

            var games = gameList.OrderBy(x => x.Name);

            foreach (Game game in games)
            {
                gamesListComboBox.Items.Add(game.Name);
            }
            FileLabel.Content = "Edit > " + gamesXMLFileName;
        }
コード例 #2
0
        private void PopulateForm(string gamesXMLFileLocation, string gamesXMLFileName)
        {
            ResetForm();
            XMLManipulation xmlRead = new XMLManipulation();

            gameList = xmlRead.ReadXmlFile(gamesXMLFileLocation);

            GamesListComboBox.Items.Clear();
            var games = gameList.OrderBy(x => x.Name);

            foreach (Game game in games)
            {
                GamesListComboBox.Items.Add(game.Name);
            }

            GamesListComboBox.Text = "Select Game";

            PingPrecisionComboBox.Items.Clear();
            PingPrecisionComboBox.Items.Add("Fast");
            PingPrecisionComboBox.Items.Add("Moderate");
            PingPrecisionComboBox.Items.Add("Thorough");

            if (gamesXMLFileName != "gamesList.xml")
            {
                CurrentFileTextBlock.Text          = gamesXMLFileName;
                CurrentFileTextBlock.Visibility    = Visibility.Visible;
                SelectGameListTextBlock.Visibility = Visibility.Hidden;
            }
            else
            {
                CurrentFileTextBlock.Visibility    = Visibility.Hidden;
                SelectGameListTextBlock.Visibility = Visibility.Visible;
            }
            SelectedFileTextBlock.Text = gamesXMLFileName;

            PingingListView.ItemsSource = pingingServerList;
        }