IMappingPoint.GetPoint Method (Predicate<ITextBuffer>, PositionAffinity)
Maps the point to a matching ITextBuffer.
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'宣言
Function GetPoint ( _
match As Predicate(Of ITextBuffer), _
affinity As PositionAffinity _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> GetPoint(
Predicate<ITextBuffer> match,
PositionAffinity affinity
)
Nullable<SnapshotPoint> GetPoint(
Predicate<ITextBuffer^>^ match,
PositionAffinity affinity
)
abstract GetPoint :
match:Predicate<ITextBuffer> *
affinity:PositionAffinity -> Nullable<SnapshotPoint>
function GetPoint(
match : Predicate<ITextBuffer>,
affinity : PositionAffinity
) : Nullable<SnapshotPoint>
Parameters
- match
Type: System.Predicate<ITextBuffer>
The predicate used to match the ITextBuffer.
- 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 SnapshotPoint in the matching buffer, or null if the point and affinity do not appear in that buffer.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | match is null. |
Remarks
match is called for each text buffer in the buffer graph until a match is found. This selects the buffer of interest, and the predicate will not be called again. If no match is found, the result is nulla null reference (Nothing in Visual Basic).
.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.