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