void ShowLogItem(LogEntity log) { AppendContent(GetParagraphForLog(log)); if (_logViewModel.IsAutoScrollToEnd) { RichTextBoxLogs.ScrollToEnd(); } }
private void ReceivedText(string message) { Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() => { RichTextBoxLogs.AppendText(Environment.NewLine + message); })); }
private void AppendRichtTextBoxLog(string text) { Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() => { RichTextBoxLogs.AppendText(Environment.NewLine + "[" + ConvertDateTimeToString(DateTime.Now) + "] " + text); })); }
void ShowLog(string log) { AppendContent(new Paragraph(new Run(log)) { Tag = DateTime.Now }); if (_logViewModel.IsAutoScrollToEnd) { RichTextBoxLogs.ScrollToEnd(); } }
public DetailView(IServerListener listener, Model.Client client) { InitializeComponent(); _listener = listener; _client = client; if (_client.LogPath != null) { RichTextBoxLogs.AppendText(File.ReadAllText(Path.GetFullPath(_client.LogPath))); } _client.TextReceived += new ReceivedText(ReceivedText); }