共用方式為


IBraceCompletionSessionProvider.TryCreateSession 方法

If appropriate, creates an IBraceCompletionSession based on the language context at the openingPoint.

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

語法

'宣告
Function TryCreateSession ( _
    textView As ITextView, _
    openingPoint As SnapshotPoint, _
    openingBrace As Char, _
    closingBrace As Char, _
    <OutAttribute> ByRef session As IBraceCompletionSession _
) As Boolean
bool TryCreateSession(
    ITextView textView,
    SnapshotPoint openingPoint,
    char openingBrace,
    char closingBrace,
    out IBraceCompletionSession session
)
bool TryCreateSession(
    ITextView^ textView, 
    SnapshotPoint openingPoint, 
    wchar_t openingBrace, 
    wchar_t closingBrace, 
    [OutAttribute] IBraceCompletionSession^% session
)
abstract TryCreateSession : 
        textView:ITextView * 
        openingPoint:SnapshotPoint * 
        openingBrace:char * 
        closingBrace:char * 
        session:IBraceCompletionSession byref -> bool
function TryCreateSession(
    textView : ITextView, 
    openingPoint : SnapshotPoint, 
    openingBrace : char, 
    closingBrace : char, 
    session : IBraceCompletionSession
) : boolean

參數

  • openingPoint
    類型:Microsoft.VisualStudio.Text.SnapshotPoint

    The insertion point of the openingBrace within the subject buffer. The content type of the subject buffer must match one of the [ContentType] attributes for this extension.

  • openingBrace
    類型:Char

    The opening brace that has been typed by the user.

  • closingBrace
    類型:Char

    The closing brace character.

傳回值

類型:Boolean
true if the openingPoint was a valid point in the buffer to start a IBraceCompletionSession.

備註

Opening points within strings and comments are usually invalid points to start an IBraceCompletionSession and return false.

.NET Framework 安全性

請參閱

參考

IBraceCompletionSessionProvider 介面

Microsoft.VisualStudio.Text.BraceCompletion 命名空間