public void ProcessChange(TextContentChangedEventArgs e) { foreach (var change in e.Changes) { var lineNumber = e.Before.GetLineNumberFromPosition(change.OldPosition); if (lineNumber < 0 || lineNumber >= _lineMap.Count) { GenericExtensions.Debug(); return; } _lineMap[lineNumber].IsModified = true; if (change.LineCountDelta >= 0) { if (lineNumber + 1 > _lineMap.Count) { GenericExtensions.Debug(); return; } _lineMap.InsertRange(lineNumber + 1, Enumerable.Range(0, change.LineCountDelta).Select(p => new LineStatus(-1))); } else { if (lineNumber + 1 > _lineMap.Count || lineNumber + 1 - change.LineCountDelta > _lineMap.Count) { GenericExtensions.Debug(); return; } _lineMap.RemoveRange(lineNumber + 1, -change.LineCountDelta); } } }
public async Task <bool> UploadExceptionAsync(SerializableException exception, bool force = false) { if (IsTelemetryEnabled || force) { GenericExtensions.Debug(); _editorContext.WriteToLog(Resources.ExceptionEncountered); _editorContext.WriteToLog(exception.GetDescription()); return(await UploadExceptionAsync(exception)); } else { return(false); } }