private void UpdateLog() { Task.Run(() => { string log = DebugApi.GetLog(); if (_currentLog != log) { _currentLog = log; this.BeginInvoke((Action)(() => { txtLog.Text = _currentLog; txtLog.SelectionLength = 0; txtLog.SelectionStart = txtLog.Text.Length; txtLog.ScrollToCaret(); })); } }); }