IMappingPoint.GetPoint Method (ITextSnapshot, PositionAffinity)
Maps the point to a particular ITextSnapshot.
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaração
Function GetPoint ( _
targetSnapshot As ITextSnapshot, _
affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> GetPoint(
ITextSnapshot targetSnapshot,
PositionAffinity affinity
)
Nullable<SnapshotPoint> GetPoint(
ITextSnapshot^ targetSnapshot,
PositionAffinity affinity
)
abstract GetPoint :
targetSnapshot:ITextSnapshot *
affinity:PositionAffinity -> Nullable<SnapshotPoint>
function GetPoint(
targetSnapshot : ITextSnapshot,
affinity : PositionAffinity
) : Nullable<SnapshotPoint>
Parameters
- targetSnapshot
Type: Microsoft.VisualStudio.Text.ITextSnapshot
The ITextSnapshot to which to map the point.
- affinity
Type: Microsoft.VisualStudio.Text.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.
Return Value
Type: System.Nullable<SnapshotPoint>
A nullable SnapshotPoint.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.