Exemplo n.º 1
0
        private void AddScriptResult(ScriptHandler.ScriptResult result)
        {
            HistoryText.Document.Blocks.Add(new Paragraph(new Run(result.Result)));
            if (result.IsError)
            {
                TextRange tr = new TextRange(HistoryText.Document.Blocks.LastBlock.ContentStart, HistoryText.Document.Blocks.LastBlock.ContentEnd);
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red);
            }

            HistoryText.Visibility = Visibility.Visible;
        }
Exemplo n.º 2
0
 private void ScriptHandler_ScriptResultReceived(object sender, ScriptHandler.ScriptResult e)
 {
     Dispatcher.Invoke(() => AddScriptResult(e));
 }