private void ProcessSave(string[] command) { if (command.Length > 1) { switch (command[1]) { case "settings": try { _commandPrompt.SaveSettings(); WriteToConsole(new ConsoleWriteLineEventArgs("Settings saved")); } catch (Exception ex) { WriteToConsole(new ConsoleWriteLineEventArgs("Error saving settings: " + ex.Message)); } break; case "commandhistory": if (command.Length == 2) { try { _commandPrompt.SaveCommandHistory(); // Saves to default WriteToConsole(new ConsoleWriteLineEventArgs("Command history saved")); } catch (Exception ex) { WriteToConsole( new ConsoleWriteLineEventArgs("Error saving command history: " + ex.Message)); } } else if (command.Length > 2) { try { _commandPrompt.SaveCommandHistory(command[2]); // File name must be in quotes: "history.xml" WriteToConsole(new ConsoleWriteLineEventArgs("Command history saved")); } catch (Exception ex) { WriteToConsole( new ConsoleWriteLineEventArgs("Error saving command history: " + ex.Message)); } } else { WriteToConsole( new ConsoleWriteLineEventArgs("Missing arguments for [" + command[1] + "] (Type 'help' for a list of commands)")); } break; case "themes": try { _commandPrompt.SaveStyleThemes(); WriteToConsole(new ConsoleWriteLineEventArgs("Style themes saved")); } catch (Exception ex) { WriteToConsole(new ConsoleWriteLineEventArgs("Error saving style themes: " + ex.Message)); } break; default: WriteToConsole( new ConsoleWriteLineEventArgs("Command not recognized: " + command[1] + " (Type 'help' for a list of commands)")); break; } } else { WriteToConsole( new ConsoleWriteLineEventArgs("Missing arguments for [" + command[0] + "]:\r" + GetCommandEntry(command[0]))); } }