public MockTrackingSpan(MockTextSnapshot snapshot, int start, int length, SpanTrackingMode trackingMode = SpanTrackingMode.EdgeExclusive) { _start = start; _length = length; _snapshot = snapshot; _trackingMode = trackingMode; switch (_trackingMode) { case SpanTrackingMode.EdgeExclusive: _startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Positive); _endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Negative); break; case SpanTrackingMode.EdgeInclusive: _startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Negative); _endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Positive); break; case SpanTrackingMode.EdgeNegative: _startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Negative); _endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Negative); break; case SpanTrackingMode.EdgePositive: _startPoint = new MockTrackingPoint(snapshot, start, PointTrackingMode.Positive); _endPoint = new MockTrackingPoint(snapshot, start + length, PointTrackingMode.Positive); break; } }
public MockTextCaret(MockTextView view) { _view = view; _position = new MockTrackingPoint((MockTextSnapshot)_view.TextBuffer.CurrentSnapshot, 0); }
public CaretPosition MoveTo(Microsoft.VisualStudio.Text.SnapshotPoint bufferPosition) { _view.Selection.Clear(); _position = new MockTrackingPoint((MockTextSnapshot)bufferPosition.Snapshot, bufferPosition.Position); return(Position); }
internal void SetPosition(SnapshotPoint position) { _position = new MockTrackingPoint((MockTextSnapshot)position.Snapshot, position.Position); }