Partilhar via


IProjectionBuffer.InsertSpan Method

Definition

Overloads

InsertSpan(Int32, ITrackingSpan)

Inserts a tracking span into the list of source spans.

InsertSpan(Int32, String)

Inserts a literal string into the list of SourceSpans.

InsertSpan(Int32, ITrackingSpan)

Inserts a tracking span into the list of source spans.

public:
 Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot ^ InsertSpan(int position, Microsoft::VisualStudio::Text::ITrackingSpan ^ spanToInsert);
public:
 Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot ^ InsertSpan(int position, Microsoft::VisualStudio::Text::ITrackingSpan ^ spanToInsert);
Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot InsertSpan(int position, Microsoft::VisualStudio::Text::ITrackingSpan const & spanToInsert);
public Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot InsertSpan (int position, Microsoft.VisualStudio.Text.ITrackingSpan spanToInsert);
abstract member InsertSpan : int * Microsoft.VisualStudio.Text.ITrackingSpan -> Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot
Public Function InsertSpan (position As Integer, spanToInsert As ITrackingSpan) As IProjectionSnapshot

Parameters

position
Int32

The position at which to insert spanToInsert.

spanToInsert
ITrackingSpan

The span to insert.

Returns

An IProjectionSnapshot.

Exceptions

position is less than zero or greater than SpanCount.

spanToInsert is null.

Adding the TextBuffer containing spanToInsert would create a cycle among a set of projection buffers by virtue of the SourceBuffer relationship.

Applies to

InsertSpan(Int32, String)

Inserts a literal string into the list of SourceSpans.

public:
 Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot ^ InsertSpan(int position, System::String ^ literalSpanToInsert);
public:
 Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot ^ InsertSpan(int position, Platform::String ^ literalSpanToInsert);
Microsoft::VisualStudio::Text::Projection::IProjectionSnapshot InsertSpan(int position, std::wstring const & literalSpanToInsert);
public Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot InsertSpan (int position, string literalSpanToInsert);
abstract member InsertSpan : int * string -> Microsoft.VisualStudio.Text.Projection.IProjectionSnapshot
Public Function InsertSpan (position As Integer, literalSpanToInsert As String) As IProjectionSnapshot

Parameters

position
Int32

The position at which to insert literalSpanToInsert.

literalSpanToInsert
String

The string to insert.

Returns

An IProjectionSnapshot.

Exceptions

position is less than zero or greater than SpanCount.

literalSpanToInsert is null. These checks are not performed if the projection buffer was created with the PermissiveEdgeInclusiveSourceSpans option.

Applies to