internal DefaultTextRangePrimitive(TextPoint startPoint, TextPoint endPoint, IEditorOptionsFactoryService editorOptionsProvider) { if (startPoint.CurrentPosition < endPoint.CurrentPosition) { _startPoint = startPoint.Clone(); _endPoint = endPoint.Clone(); } else { _endPoint = startPoint.Clone(); _startPoint = endPoint.Clone(); } _editorOptionsProvider = editorOptionsProvider; _editorOptions = _editorOptionsProvider.GetOptions(_startPoint.TextBuffer.AdvancedTextBuffer); }
public override void SetEnd(TextPoint endPoint) { if (endPoint.TextBuffer != TextBuffer) { throw new ArgumentException("startPoint"); } if (endPoint.CurrentPosition < _startPoint.CurrentPosition) { _endPoint = _startPoint; _startPoint = endPoint.Clone(); } else { _endPoint = endPoint.Clone(); } }
public override void SetStart(TextPoint startPoint) { if (startPoint.TextBuffer != TextBuffer) { throw new ArgumentException(Strings.StartPointFromWrongBuffer); } if (startPoint.CurrentPosition > _endPoint.CurrentPosition) { _startPoint = _endPoint; _endPoint = startPoint.Clone(); } else { _startPoint = startPoint.Clone(); } }
public void SelectAll() { //_disabledTemporary = false; _forwardPivot.Line = _owner.CharacterDocument.FirstLine.ID; _forwardPivot.Column = 0; _backwardPivot = (TextPoint)_forwardPivot.Clone(); _forwardDestination.Line = _owner.CharacterDocument.LastLine.ID; _forwardDestination.Column = _owner.CharacterDocument.LastLine.DisplayLength; _backwardDestination = (TextPoint)_forwardDestination.Clone(); _pivotType = RangeType.Char; FixSelection(); }
public override TextPoint GetEndPoint() { return(_endPoint.Clone()); }
public override TextPoint GetStartPoint() { return(_startPoint.Clone()); }