다음을 통해 공유


IPersistentSpanFactory.Create Method

Definition

Overloads

Create(SnapshotSpan, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently open.

Create(String, Span, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently closed.

Create(ITextSnapshot, Int32, Int32, Int32, Int32, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently open.

Create(String, Int32, Int32, Int32, Int32, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently closed.

Create(SnapshotSpan, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently open.

public:
 Microsoft::VisualStudio::Text::IPersistentSpan ^ Create(Microsoft::VisualStudio::Text::SnapshotSpan span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode);
public Microsoft.VisualStudio.Text.IPersistentSpan Create (Microsoft.VisualStudio.Text.SnapshotSpan span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode);
abstract member Create : Microsoft.VisualStudio.Text.SnapshotSpan * Microsoft.VisualStudio.Text.SpanTrackingMode -> Microsoft.VisualStudio.Text.IPersistentSpan
Public Function Create (span As SnapshotSpan, trackingMode As SpanTrackingMode) As IPersistentSpan

Parameters

span
SnapshotSpan

The span of text in this snapshot.

trackingMode
SpanTrackingMode

How the tracking span will react to changes at its boundaries.

Returns

The newly created span or null if one can not be created.

Applies to

Create(String, Span, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently closed.

public:
 Microsoft::VisualStudio::Text::IPersistentSpan ^ Create(System::String ^ filePath, Microsoft::VisualStudio::Text::Span span, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode);
public Microsoft.VisualStudio.Text.IPersistentSpan Create (string filePath, Microsoft.VisualStudio.Text.Span span, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode);
abstract member Create : string * Microsoft.VisualStudio.Text.Span * Microsoft.VisualStudio.Text.SpanTrackingMode -> Microsoft.VisualStudio.Text.IPersistentSpan
Public Function Create (filePath As String, span As Span, trackingMode As SpanTrackingMode) As IPersistentSpan

Parameters

filePath
String

Name of the file that contains the span.

span
Span

Span as character offsets from the start of the file.

trackingMode
SpanTrackingMode

How the tracking span will react to changes at its boundaries.

Returns

The newly created span.

Remarks

Using this method to create an IPersistentSpan on a document that is already open is an error (and will prevent the span from tracking properly).

Applies to

Create(ITextSnapshot, Int32, Int32, Int32, Int32, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently open.

public:
 Microsoft::VisualStudio::Text::IPersistentSpan ^ Create(Microsoft::VisualStudio::Text::ITextSnapshot ^ snapshot, int startLine, int startIndex, int endLine, int endIndex, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode);
public Microsoft.VisualStudio.Text.IPersistentSpan Create (Microsoft.VisualStudio.Text.ITextSnapshot snapshot, int startLine, int startIndex, int endLine, int endIndex, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode);
abstract member Create : Microsoft.VisualStudio.Text.ITextSnapshot * int * int * int * int * Microsoft.VisualStudio.Text.SpanTrackingMode -> Microsoft.VisualStudio.Text.IPersistentSpan
Public Function Create (snapshot As ITextSnapshot, startLine As Integer, startIndex As Integer, endLine As Integer, endIndex As Integer, trackingMode As SpanTrackingMode) As IPersistentSpan

Parameters

snapshot
ITextSnapshot

The snapshot of the currently open document to create the span on.

startLine
Int32

Line number of the start point.

startIndex
Int32

Character offset from the start of the line containing the start point.

endLine
Int32

Line number of the end point.

endIndex
Int32

Character offset from the start of the line containing the end point.

trackingMode
SpanTrackingMode

How the tracking span will react to changes at its boundaries.

Returns

The newly created span.

Applies to

Create(String, Int32, Int32, Int32, Int32, SpanTrackingMode)

Create an IPersistentSpan for a snapshot span on a document that is currently closed.

public:
 Microsoft::VisualStudio::Text::IPersistentSpan ^ Create(System::String ^ filePath, int startLine, int startIndex, int endLine, int endIndex, Microsoft::VisualStudio::Text::SpanTrackingMode trackingMode);
public Microsoft.VisualStudio.Text.IPersistentSpan Create (string filePath, int startLine, int startIndex, int endLine, int endIndex, Microsoft.VisualStudio.Text.SpanTrackingMode trackingMode);
abstract member Create : string * int * int * int * int * Microsoft.VisualStudio.Text.SpanTrackingMode -> Microsoft.VisualStudio.Text.IPersistentSpan
Public Function Create (filePath As String, startLine As Integer, startIndex As Integer, endLine As Integer, endIndex As Integer, trackingMode As SpanTrackingMode) As IPersistentSpan

Parameters

filePath
String

Name of the file that contains the span.

startLine
Int32

Line number of the start point.

startIndex
Int32

Character offset from the start of the line containing the start point.

endLine
Int32

Line number of the end point.

endIndex
Int32

Character offset from the start of the line containing the end point.

trackingMode
SpanTrackingMode

How the tracking span will react to changes at its boundaries.

Returns

The newly created span.

Remarks

Using this method to create an IPersistentSpan on a document that is already open is an error (and will prevent the span from tracking properly).

Applies to