IMappingPoint.GetPoint Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetPoint(ITextBuffer, PositionAffinity) |
Maps the point to a particular ITextBuffer. |
GetPoint(ITextSnapshot, PositionAffinity) |
Maps the point to a particular ITextSnapshot. |
GetPoint(Predicate<ITextBuffer>, PositionAffinity) |
Maps the point to a matching ITextBuffer. |
GetPoint(ITextBuffer, PositionAffinity)
Maps the point to a particular ITextBuffer.
public:
Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> GetPoint(Microsoft::VisualStudio::Text::ITextBuffer ^ targetBuffer, Microsoft::VisualStudio::Text::PositionAffinity affinity);
public Microsoft.VisualStudio.Text.SnapshotPoint? GetPoint (Microsoft.VisualStudio.Text.ITextBuffer targetBuffer, Microsoft.VisualStudio.Text.PositionAffinity affinity);
abstract member GetPoint : Microsoft.VisualStudio.Text.ITextBuffer * Microsoft.VisualStudio.Text.PositionAffinity -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function GetPoint (targetBuffer As ITextBuffer, affinity As PositionAffinity) As Nullable(Of SnapshotPoint)
Parameters
- targetBuffer
- ITextBuffer
The ITextBuffer to which to map the point.
- affinity
- PositionAffinity
If the mapping is ambiguous (the position lies on a source span seam), this parameter affects the mapping as follows:
if affinity
is Predecessor, the mapping targets
the position immediately after the preceding character in the anchor buffer; if affinity
is
Successor, the mapping targets the position immediately before the following character
in the anchor buffer. This parameter has no effect if the mapping is unambiguous.
Returns
A SnapshotPoint in the targeted buffer or null if the point and affinity do not appear in that buffer.
Exceptions
targetBuffer
is null.
Remarks
In general, a source span seam occurs at the end of a source span of nonzero length and the beginning of a source span of nonzero length, and coincides with zero or more source spans of zero length. Every span on a seam has a point in the result collection.
Applies to
GetPoint(ITextSnapshot, PositionAffinity)
Maps the point to a particular ITextSnapshot.
public:
Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> GetPoint(Microsoft::VisualStudio::Text::ITextSnapshot ^ targetSnapshot, Microsoft::VisualStudio::Text::PositionAffinity affinity);
public Microsoft.VisualStudio.Text.SnapshotPoint? GetPoint (Microsoft.VisualStudio.Text.ITextSnapshot targetSnapshot, Microsoft.VisualStudio.Text.PositionAffinity affinity);
abstract member GetPoint : Microsoft.VisualStudio.Text.ITextSnapshot * Microsoft.VisualStudio.Text.PositionAffinity -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function GetPoint (targetSnapshot As ITextSnapshot, affinity As PositionAffinity) As Nullable(Of SnapshotPoint)
Parameters
- targetSnapshot
- ITextSnapshot
The ITextSnapshot to which to map the point.
- affinity
- PositionAffinity
If the mapping is ambiguous (the position lies on a source span seam), this parameter affects the mapping as follows:
if affinity
is Predecessor, the mapping targets
the position immediately after the preceding character in the anchor buffer; if affinity
is
Successor, the mapping targets the position immediately before the following character
in the anchor buffer. This parameter has no effect if the mapping is unambiguous.
Returns
A SnapshotPoint in the targeted buffer or null if the point and affinity do not appear in that buffer.
Exceptions
targetSnapshot
is null.
Remarks
In general, a source span seam occurs at the end of a source span of nonzero length and the beginning of a source span of nonzero length, and coincides with zero or more source spans of zero length. Every span on a seam has a point in the result collection.
Applies to
GetPoint(Predicate<ITextBuffer>, PositionAffinity)
Maps the point to a matching ITextBuffer.
public:
Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> GetPoint(Predicate<Microsoft::VisualStudio::Text::ITextBuffer ^> ^ match, Microsoft::VisualStudio::Text::PositionAffinity affinity);
public Microsoft.VisualStudio.Text.SnapshotPoint? GetPoint (Predicate<Microsoft.VisualStudio.Text.ITextBuffer> match, Microsoft.VisualStudio.Text.PositionAffinity affinity);
abstract member GetPoint : Predicate<Microsoft.VisualStudio.Text.ITextBuffer> * Microsoft.VisualStudio.Text.PositionAffinity -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function GetPoint (match As Predicate(Of ITextBuffer), affinity As PositionAffinity) As Nullable(Of SnapshotPoint)
Parameters
- match
- Predicate<ITextBuffer>
The predicate used to match the ITextBuffer.
- affinity
- PositionAffinity
If the mapping is ambiguous (the position lies on a source span seam), this parameter affects the mapping as follows:
if affinity
is Predecessor, the mapping targets
the position immediately after the preceding character in the anchor buffer; if affinity
is
Successor, the mapping targets the position immediately before the following character
in the anchor buffer. This parameter has no effect if the mapping is unambiguous.
Returns
A SnapshotPoint in the matching buffer, or null if the point and affinity do not appear in that buffer.
Exceptions
match
is null.
Remarks
match
will be called as text buffers in the buffer graph are encountered, until a match is found. This selects the buffer of interest and match
is not called again. If no match is found with any of the buffers, the result is null.