Compartir a través de


IBraceCompletionContextProvider.TryCreateContext Method

Creates an IBraceCompletionContext to handle language specific actions such as parsing and formatting.

Namespace:  Microsoft.VisualStudio.Text.BraceCompletion
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

Syntax

'Declaration
Function TryCreateContext ( _
    textView As ITextView, _
    openingPoint As SnapshotPoint, _
    openingBrace As Char, _
    closingBrace As Char, _
    <OutAttribute> ByRef context As IBraceCompletionContext _
) As Boolean
bool TryCreateContext(
    ITextView textView,
    SnapshotPoint openingPoint,
    char openingBrace,
    char closingBrace,
    out IBraceCompletionContext context
)
bool TryCreateContext(
    ITextView^ textView, 
    SnapshotPoint openingPoint, 
    wchar_t openingBrace, 
    wchar_t closingBrace, 
    [OutAttribute] IBraceCompletionContext^% context
)
abstract TryCreateContext : 
        textView:ITextView * 
        openingPoint:SnapshotPoint * 
        openingBrace:char * 
        closingBrace:char * 
        context:IBraceCompletionContext byref -> bool
function TryCreateContext(
    textView : ITextView, 
    openingPoint : SnapshotPoint, 
    openingBrace : char, 
    closingBrace : char, 
    context : IBraceCompletionContext
) : boolean

Parameters

  • openingBrace
    Type: Char

    The opening brace that has been typed by the user.

  • closingBrace
    Type: Char

    The closing brace character.

Return Value

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

Remarks

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

.NET Framework Security

See Also

Reference

IBraceCompletionContextProvider Interface

Microsoft.VisualStudio.Text.BraceCompletion Namespace