private void Load() { var path = Storage.GetDefaultTapeFileName(); if (String.IsNullOrWhiteSpace(path)) { path = Storage.FILE_NAME_NEW; } bool selectFile = true; if (Storage.IsFileNameToken(path)) { path = System.IO.Path.Combine(Storage.AppDataPath, "Tapes\\"); selectFile = false; } path = Storage.GetTapeFilePath(Prompt: "Select tape file to load", DefaultPath: path, Save: false, SelectFileInDialog: selectFile); if (path.Length > 0) { if (Computer.TapeLoad(path)) { Settings.LastTapeFile = Computer.TapeFilePath; } else { Dialogs.AlertUser("Failed to load tape file."); return; } } MessageCallback("Tape Loaded"); }
private bool Import() { string path = Settings.LastCmdFile; if (String.IsNullOrWhiteSpace(path)) { path = Path.Combine(Storage.AppDataPath, @"CMD Files\"); } path = Dialogs.GetCommandFilePath(path); if (path.Length > 0) { CmdFile = new CmdFile(path); if (CmdFile.Valid) { Settings.LastCmdFile = path; return(true); } else { Dialogs.AlertUser("CMD File import failed: file not valid"); return(false); } } else { return(false); } }
private bool ShowPrinterOutput() { if (Computer.PrinterHasContent) { System.IO.Directory.CreateDirectory(Storage.DefaultPrintDir); string filePath = System.IO.Path.Combine(Storage.DefaultPrintDir, "Printer.txt").MakeUniquePath(); System.IO.File.WriteAllText(filePath, Computer.PrinterContent); Dialogs.ShowTextFile(filePath); return(true); } else { Dialogs.AlertUser("Nothing printed yet."); return(false); } }