private void ExportCSVButton_Click(object sender, RoutedEventArgs e) { string outputFile = string.Empty; SaveFileDialog csvsfd = new SaveFileDialog(); csvsfd.Filter = "CSV documents (.csv)|*.csv"; //filter files by extension int.TryParse(LevelSet.Text, out levelup); csvsfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); // Show file dialog box Nullable <bool> result = csvsfd.ShowDialog(); if (result == true) { SoldierTextFileGenerator.WriteCSVFile(csvsfd, soldierList); } }
private void GenerateFileButton_Click(object sender, RoutedEventArgs e) { int.TryParse(LevelSet.Text, out levelup); inputFileName = "cheat.txt"; char driveLetter = Convert.ToChar(DriveLetterSetTextBox.Text); if (LocationOverride.IsChecked == true) { soldierList = SoldierTextFileGenerator.GenerateCheatFile(soldierList, inputFileName, levelup, XcomDirectoryOverride, LongWarCheckBox.IsChecked, RichardsClassesCheckBox.IsChecked); } else if ((bool)WoTCLocationCheckBox.IsChecked) { soldierList = SoldierTextFileGenerator.GenerateCheatFile(soldierList, inputFileName, levelup, XcomDirectoryOverride, LongWarCheckBox.IsChecked, RichardsClassesCheckBox.IsChecked); } else { soldierList = SoldierTextFileGenerator.GenerateCheatFile(soldierList, inputFileName, levelup, driveLetter, LongWarCheckBox.IsChecked, RichardsClassesCheckBox.IsChecked); } }