private static void AddCommandToHistory(string Command) { List <string> History = GetCommandHistory(); if (History.Count > 0 && History[0].Equals(Command)) { // Don't store the last as last command return; } File CmdFile = GetHistoryFile(); if (CmdFile == null) { return; } CmdFile.SeekEnd(); CmdFile.StoreLine(Command); CmdFile.Close(); }
// Writes the message to the log file private static void LogToFile(string Message) { OpenLogFile(); LogFile?.StoreLine(Message); LogFile?.Close(); }