DroidExplorer.Core.UI.CConsole.ConsoleControl.ScrollHistory C# (CSharp) Method

ScrollHistory() private method

private ScrollHistory ( ) : void
return void
        private void ScrollHistory()
        {
            richTextBoxConsole.Select(InputStart, richTextBoxConsole.Text.Length - InputStart);
            if(HistoryIndex < 0) {
                // past the end
                richTextBoxConsole.SelectedText = string.Empty;
                HistoryIndex = 0;
            } else if(HistoryIndex >= CommandHistory.Count) {
                // past the end
                richTextBoxConsole.SelectedText = string.Empty;
                HistoryIndex = CommandHistory.Count;
            } else {
                richTextBoxConsole.SelectedText = CommandHistory[HistoryIndex];
            }
            richTextBoxConsole.Select(richTextBoxConsole.Text.Length, 0);
        }