private void LoadHtx_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog { Filter = "SCR file|*.scr" }; if (openFileDialog.ShowDialog() == true) { string scrFile = openFileDialog.FileName; string htxFile = scrFile.Replace(".scr", ".htx"); Htx = Htx.ParseFromFile(htxFile); Scr = Scr.ParseFromFile(scrFile, Htx); scrBox.ItemsSource = Scr.Commands; } }
private async Task SaveHtx_Click_Async(object sender, RoutedEventArgs e) { SaveFileDialog saveFileDialog = new SaveFileDialog { Filter = "SCR file|*.scr", AddExtension = true }; if (saveFileDialog.ShowDialog() == true) { string scrFile = saveFileDialog.FileName; string htxFile = scrFile.Replace(".scr", ".htx"); var htx = await Scr.WriteToFile(scrFile); await htx.WriteToFile(htxFile); } }