Пример #1
0
        // SAVE CHANGES TO FILE
        private void SaveButton_Click(object sender, EventArgs e)
        {
            XMLManipulation xML = new XMLManipulation();

            xML.WriteXMLFile(gameFileLocation, gameList);
            isSavingFile = true;
            this.Close();
        }
Пример #2
0
 public PingWindow()
 {
     InitializeComponent();
     if (!File.Exists(chosenGameList))
     {
         XMLManipulation XML = new XMLManipulation();
         XML.CreateFreshGameList(chosenGameList);
     }
     LoadPingImages();
     PopulateForm(chosenGameList, System.IO.Path.GetFileName(chosenGameList));
     SetPingSettings();
 }
Пример #3
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;
        }
Пример #4
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;
        }