public void Write()

in SamplesV1/ADFSecurePublish/SecurePublishForm/MainWindow.xaml.cs [301:345]


        public void Write(string format, params object[] args)
        {
            Dispatcher.Invoke(() =>
            {
                if (args != null && args.Length == 1)
                {
                    string color = (string)args[0];

                    BrushConverter bc = new BrushConverter();
                    TextRange tr = new TextRange(outputBox.Document.ContentEnd, outputBox.Document.ContentEnd)
                    {
                        Text = format
                    };

                    try
                    {
                        tr.ApplyPropertyValue(TextElement.ForegroundProperty, bc.ConvertFromString(color));
                        tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
                    }
                    catch (FormatException)
                    {
                        TextRange tr2 = new TextRange(outputBox.Document.ContentEnd, outputBox.Document.ContentEnd)
                        {
                            Text = format
                        };

                        tr2.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Black);
                        tr2.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
                    }
                }
                else
                {
                    TextRange tr = new TextRange(outputBox.Document.ContentEnd, outputBox.Document.ContentEnd)
                    {
                        Text = format
                    };

                    tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Black);
                    tr.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Normal);
                }

                outputBox.AppendText("\u2028"); // Linebreak, not paragraph break
                outputBox.ScrollToEnd();
            });
        }