コード例 #1
0
        public DefaultTextPointPrimitive(
            TextBuffer textBuffer,
            int position,
            ITextSearchService findLogic,
            IEditorOptions editorOptions,
            ITextStructureNavigator textStructureNavigator,
            IBufferPrimitivesFactoryService bufferPrimitivesFactory)
        {
            if ((position < 0) ||
                (position > textBuffer.AdvancedTextBuffer.CurrentSnapshot.Length))
            {
                throw new ArgumentOutOfRangeException(nameof(position));
            }

            _textBuffer             = textBuffer;
            _trackingPoint          = _textBuffer.AdvancedTextBuffer.CurrentSnapshot.CreateTrackingPoint(0, PointTrackingMode.Positive);
            _editorOptions          = editorOptions;
            _textStructureNavigator = textStructureNavigator;
            _findLogic = findLogic;
            _bufferPrimitivesFactory = bufferPrimitivesFactory;

            MoveTo(position);
        }
コード例 #2
0
 public DefaultBufferPrimitive(ITextBuffer textBuffer, IBufferPrimitivesFactoryService bufferPrimitivesFactory)
 {
     _textBuffer = textBuffer;
     _bufferPrimitivesFactory = bufferPrimitivesFactory;
 }
コード例 #3
0
 public BufferPrimitives(ITextBuffer textBuffer, IBufferPrimitivesFactoryService bufferPrimitivesFactory)
 {
     _textBuffer = bufferPrimitivesFactory.CreateTextBuffer(textBuffer);
 }
コード例 #4
0
        internal DefaultTextViewPrimitive(ITextView textView, IViewPrimitivesFactoryService viewPrimitivesFactory, IBufferPrimitivesFactoryService bufferPrimitivesFactory)
        {
            _textView = textView;

            _viewPrimitivesFactory = viewPrimitivesFactory;

            _textBuffer = bufferPrimitivesFactory.CreateTextBuffer(textView.TextBuffer);

            _caret     = _viewPrimitivesFactory.CreateCaret(this);
            _selection = _viewPrimitivesFactory.CreateSelection(this);
        }