ConsoleControl.ConsoleControl.WriteOutput C# (CSharp) Method

WriteOutput() private method

Writes the output to the console control.
private WriteOutput ( string output, Color color ) : void
output string The output.
color Color The color.
return void
		private void WriteOutput(string output, Color color) {
			//if (string.IsNullOrEmpty(lastInput) == false && (output == lastInput || output.Replace("\r\n", "") == lastInput))
			if (!string.IsNullOrEmpty(lastInput) && (output == lastInput || output.Replace("\r\n", "") == lastInput))
				return;
			ClearOutput(false, this._ShouldClear);
			// Write the output.
			richTextBoxConsole.SelectionColor = color;
			richTextBoxConsole.SelectedText += output;
			inputStart = richTextBoxConsole.SelectionStart;
		}

Usage Example

Beispiel #1
0
 private void sendConsoleOutputValue(string value, Color color)
 {
     console.WriteOutput(value, color);
     console.InternalRichTextBox.ScrollToCaret();
 }