public void Clear() { FlushConsoleToDisc(Entries.Count); Entries.Clear(); CommandsCache.Clear(); CurrentCommand = null; CommandBuilder.Clear(); }
private void Add(string commandText, bool isUserInput = false) { if (commandText.IsFilled()) { var entry = new ConsoleEntry(commandText.Trim(), isUserInput); if (isUserInput) { CommandsCache.AddLast(entry); CurrentCommand = CommandsCache.Last; } Entries.Add(entry); // Flush console to disc if it exceeds its limit if (Entries.Count >= MAX_CONSOLE_ENTRIES) { FlushConsoleToDisc(MAX_CONSOLE_ENTRIES / 2); } } }