Compartilhar via


IProjectionBuffer.InsertSpan Method (Int32, ITrackingSpan)

Inserts a tracking span into the list of source spans.

Namespace:  Microsoft.VisualStudio.Text.Projection
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Declaration
Function InsertSpan ( _
    position As Integer, _
    spanToInsert As ITrackingSpan _
) As IProjectionSnapshot
IProjectionSnapshot InsertSpan(
    int position,
    ITrackingSpan spanToInsert
)
IProjectionSnapshot^ InsertSpan(
    int position, 
    ITrackingSpan^ spanToInsert
)
abstract InsertSpan : 
        position:int * 
        spanToInsert:ITrackingSpan -> IProjectionSnapshot
function InsertSpan(
    position : int, 
    spanToInsert : ITrackingSpan
) : IProjectionSnapshot

Parameters

  • position
    Type: Int32

    The position at which to insert spanToInsert.

Return Value

Type: Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot
An IProjectionSnapshot.

Exceptions

Exception Condition
ArgumentNullException

spanToInsert is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

position is less than zero or greater than the number of spans.

ArgumentException

spanToInsert would cause a duplicated projection, or spanToInsert is EdgeInclusive and does not cover its entire buffer, or is EdgePositive and does not abut the end of its buffer, or is EdgeNegative and does not abut the beginning of its buffer.

(These checks are not performed if the projection buffer was created with the PermissiveEdgeInclusiveSourceSpans option.)

Or: adding the text buffer containing spanToInsert would create a cycle among a set of projection buffers.

.NET Framework Security

See Also

Reference

IProjectionBuffer Interface

InsertSpan Overload

Microsoft.VisualStudio.Text.Projection Namespace