예제 #1
0
        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;
            }
        }
예제 #2
0
 public MockTextCaret(MockTextView view)
 {
     _view     = view;
     _position = new MockTrackingPoint((MockTextSnapshot)_view.TextBuffer.CurrentSnapshot, 0);
 }
예제 #3
0
 public CaretPosition MoveTo(Microsoft.VisualStudio.Text.SnapshotPoint bufferPosition)
 {
     _view.Selection.Clear();
     _position = new MockTrackingPoint((MockTextSnapshot)bufferPosition.Snapshot, bufferPosition.Position);
     return(Position);
 }
예제 #4
0
 internal void SetPosition(SnapshotPoint position)
 {
     _position = new MockTrackingPoint((MockTextSnapshot)position.Snapshot, position.Position);
 }