static void Main(string[] args) { var ggpkPath = args.Length > 0 ? args[0] : ""; while (!TestPath(ggpkPath)) { Console.Write("Enter full GGPK name (path + filename) # "); ggpkPath = Console.ReadLine(); } var workerThread = new Thread(() => { var content = new GrindingGearsPackageContainer(); try { content.Read(ggpkPath, Output); content.Save(ggpkPath + ".defragmented", Output); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); return; } OutputLine("Defragmented GGPK Successfully"); }); workerThread.Start(); }
private void OnSaveClicked(object sender, RoutedEventArgs e) { // save GGPK contents var openFileDialog = new OpenFileDialog { FileName = "", CheckFileExists = true, CheckPathExists = true }; if (openFileDialog.ShowDialog() != true) { return; } ResetViewer(); TextBoxOutput.Visibility = Visibility.Visible; TextBoxOutput.Text = string.Empty; _content.Save(openFileDialog.FileName, OutputLine); }