共用方式為


IMappingPoint.GetInsertionPoint 方法

將點對應至相符之 ITextBuffer 中的插入點。

命名空間:  Microsoft.VisualStudio.Text
組件:  Microsoft.VisualStudio.Text.Data (在 Microsoft.VisualStudio.Text.Data.dll 中)

語法

'宣告
Function GetInsertionPoint ( _
    match As Predicate(Of ITextBuffer) _
) As Nullable(Of SnapshotPoint)
Nullable<SnapshotPoint> GetInsertionPoint(
    Predicate<ITextBuffer> match
)
Nullable<SnapshotPoint> GetInsertionPoint(
    Predicate<ITextBuffer^>^ match
)
abstract GetInsertionPoint : 
        match:Predicate<ITextBuffer> -> Nullable<SnapshotPoint> 
function GetInsertionPoint(
    match : Predicate<ITextBuffer>
) : Nullable<SnapshotPoint>

參數

傳回值

類型:Nullable<SnapshotPoint>
A SnapshotPoint中相符的緩衝區,或nullnull 參考 (即 Visual Basic 中的 Nothing)如果點不會出現在該緩衝區。

例外狀況

例外狀況 條件
ArgumentNullException

match 為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

備註

最常見的情況下,在這項計算會對應到投影的緩衝區,受制於呼叫者核准使用match。 如果投影對應沒有模稜兩可,解決方式是呼叫GetTypicalInsertionPosition

match會呼叫緩衝區圖形中的每個文字緩衝區,直到找到符合項目。 選取感興趣,緩衝區和述詞不會呼叫一次。 如果沒有找到符合的就會產生nullnull 參考 (即 Visual Basic 中的 Nothing)。

.NET Framework 安全性

請參閱

參考

IMappingPoint 介面

Microsoft.VisualStudio.Text 命名空間