private void AppendTextSafely(string message) { // Based on msdn information: https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls if (Txtconversation.InvokeRequired) { StringArgReturningVoidDelegate d = AppendTextSafely; Invoke(d, message); } else { Txtconversation.AppendText(message); } }
private void ShowConvo(Contact contact) { Txtconversation.ResetText(); MessageRepo?.GetMessages(contact)?.ToList().ForEach(PrintMessage); }