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); })); }
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); }