// Token: 0x060035B5 RID: 13749 RVA: 0x000F4040 File Offset: 0x000F2240 private void DebugAssertRunList() { Invariant.Assert(this._runList.Count >= 1, "Run list should never be empty!"); if (Invariant.Strict) { SpellerStatusTable.RunType runType = SpellerStatusTable.RunType.Clean; for (int i = 0; i < this._runList.Count; i++) { SpellerStatusTable.Run run = this.GetRun(i); if (this._runList.Count == 1) { Invariant.Assert(run.Position.CompareTo(run.Position.TextContainer.Start) == 0); } else { Invariant.Assert(run.Position.CompareTo(this.GetRunEndPosition(i)) <= 0, "Found negative width run!"); } Invariant.Assert(i == 0 || this.GetRunEndPosition(i - 1).CompareTo(run.Position) <= 0, "Found overlapping runs!"); if (!this.IsErrorRun(i)) { Invariant.Assert(i == 0 || runType != run.RunType, "Found consecutive dirty/dirt or clean/clean runs!"); } runType = run.RunType; } } }
// Token: 0x060035AF RID: 13743 RVA: 0x000F3B94 File Offset: 0x000F1D94 private void MarkRange(ITextPointer start, ITextPointer end, SpellerStatusTable.RunType runType) { if (start.CompareTo(end) == 0) { return; } Invariant.Assert(runType == SpellerStatusTable.RunType.Clean || runType == SpellerStatusTable.RunType.Dirty); int num = this.FindIndex(start.CreateStaticPointer(), LogicalDirection.Forward); int num2 = this.FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); Invariant.Assert(num >= 0); Invariant.Assert(num2 >= 0); if (num + 1 < num2) { for (int i = num + 1; i < num2; i++) { this.NotifyHighlightLayerBeforeRunChange(i); } this._runList.RemoveRange(num + 1, num2 - num - 1); num2 = num + 1; } if (num == num2) { this.AddRun(num, start, end, runType); return; } Invariant.Assert(num == num2 - 1); this.AddRun(num, start, end, runType); num2 = this.FindIndex(end.CreateStaticPointer(), LogicalDirection.Backward); Invariant.Assert(num2 >= 0); this.AddRun(num2, start, end, runType); }
// Token: 0x060035B0 RID: 13744 RVA: 0x000F3C68 File Offset: 0x000F1E68 private void AddRun(int index, ITextPointer start, ITextPointer end, SpellerStatusTable.RunType runType) { Invariant.Assert(runType == SpellerStatusTable.RunType.Clean || runType == SpellerStatusTable.RunType.Dirty); Invariant.Assert(start.CompareTo(end) < 0); SpellerStatusTable.RunType runType2 = (runType == SpellerStatusTable.RunType.Clean) ? SpellerStatusTable.RunType.Dirty : SpellerStatusTable.RunType.Clean; SpellerStatusTable.Run run = this.GetRun(index); if (run.RunType == runType) { this.TryToMergeRunWithNeighbors(index); return; } if (run.RunType != runType2) { run.RunType = runType; ITextPointer position = run.Position; ITextPointer runEndPositionDynamic = this.GetRunEndPositionDynamic(index); this.TryToMergeRunWithNeighbors(index); this._highlightLayer.FireChangedEvent(position, runEndPositionDynamic); return; } if (run.Position.CompareTo(start) >= 0) { if (this.GetRunEndPosition(index).CompareTo(end) <= 0) { run.RunType = runType; this.TryToMergeRunWithNeighbors(index); return; } if (index > 0 && this.GetRun(index - 1).RunType == runType) { run.Position = end; return; } run.RunType = runType; SpellerStatusTable.Run value = new SpellerStatusTable.Run(end, runType2); this._runList.Insert(index + 1, value); return; } else { SpellerStatusTable.Run value; if (this.GetRunEndPosition(index).CompareTo(end) > 0) { value = new SpellerStatusTable.Run(start, runType); this._runList.Insert(index + 1, value); value = new SpellerStatusTable.Run(end, runType2); this._runList.Insert(index + 2, value); return; } if (index < this._runList.Count - 1 && this.GetRun(index + 1).RunType == runType) { this.GetRun(index + 1).Position = start; return; } value = new SpellerStatusTable.Run(start, runType); this._runList.Insert(index + 1, value); return; } }
// Token: 0x060035AC RID: 13740 RVA: 0x000F3A70 File Offset: 0x000F1C70 internal bool GetRun(StaticTextPointer position, LogicalDirection direction, out SpellerStatusTable.RunType runType, out StaticTextPointer end) { int num = this.FindIndex(position, direction); runType = SpellerStatusTable.RunType.Clean; end = StaticTextPointer.Null; if (num < 0) { return(false); } SpellerStatusTable.Run run = this.GetRun(num); runType = run.RunType; end = ((direction == LogicalDirection.Forward) ? this.GetRunEndPosition(num) : run.Position.CreateStaticPointer()); return(true); }
// Token: 0x060035A9 RID: 13737 RVA: 0x000F3938 File Offset: 0x000F1B38 internal bool IsRunType(StaticTextPointer textPosition, LogicalDirection direction, SpellerStatusTable.RunType runType) { int num = this.FindIndex(textPosition, direction); return(num >= 0 && this.GetRun(num).RunType == runType); }
// Token: 0x06008593 RID: 34195 RVA: 0x00249D84 File Offset: 0x00247F84 internal Run(ITextPointer position, SpellerStatusTable.RunType runType) { this._position = position.GetFrozenPointer(LogicalDirection.Backward); this._runType = runType; }