private async Task SetDiffEditorText() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); var fileName = GetSelectedFileName(); if (fileName == null) { this.ClearEditor(); diffLines = new string[0]; return; } if (!_refreshing) { try { await TaskScheduler.Default; var tmpFileName = CurrentTracker.Diff(fileName); await SetEditorText(tmpFileName); } catch (Exception ex) { string message = ex.Message; Action action = () => ShowStatusMessage(message); Dispatcher.Invoke(action); } } ; }