title: adding new line to richtextbox with different color in c#
body: <p>I created a program that sends a command to the cmd, gets the output from the cmd and show it in a richtextbox with colors.
  I wrote this function:</p>
  
  <pre><code>           System.Windows.Documents.TextRange rangeOfText =
                  new System.Windows.Documents.TextRange(this.Console.Document.ContentEnd,
                      this.Console.Document.ContentEnd)
                  { Text = line + "\n" };
              rangeOfText.ApplyPropertyValue(TextElement.ForegroundProperty, color);
  </code></pre>
  
  <p>this.Console is my richtextbox.</p>
  
  <p>the problem is that I get lots of lines from the cmd, so the UI is blocked a lot.
  Is there something more effective than this?</p>