共用方式為


IVsLanguageContextProvider.UpdateLanguageContext Method

Provides context from the language service to the Visual Studio core editor.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'宣告
Function UpdateLanguageContext ( _
    dwHint As UInteger, _
    pBuffer As IVsTextLines, _
    ptsSelection As TextSpan(), _
    pUC As Object _
) As Integer
int UpdateLanguageContext(
    uint dwHint,
    IVsTextLines pBuffer,
    TextSpan[] ptsSelection,
    Object pUC
)
int UpdateLanguageContext(
    unsigned int dwHint, 
    IVsTextLines^ pBuffer, 
    array<TextSpan>^ ptsSelection, 
    Object^ pUC
)
abstract UpdateLanguageContext : 
        dwHint:uint32 * 
        pBuffer:IVsTextLines * 
        ptsSelection:TextSpan[] * 
        pUC:Object -> int 
function UpdateLanguageContext(
    dwHint : uint, 
    pBuffer : IVsTextLines, 
    ptsSelection : TextSpan[], 
    pUC : Object
) : int

Parameters

  • dwHint
    Type: System.UInt32
    [in] Value indicating whether this is a typical idle-time update of the context bag or a request for F1 Help. For a list of dwHint values, see LanguageContextHint.
  • pUC
    Type: System.Object
    [in, out] Pointer to the context bag on the Visual Studio core text editor.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsLanguageContextProvider::UpdateLanguageContext(
   DWORD dwHint, 
   IVsTextLines *pBuffer, 
   TextSpan *ptsSelection
);

UpdateLanguageContext return values:

S_OK: the implementer has added whatever context should be added.

Any other success code: forbidden (caller will assert).

Any failure code: means the implementer is "passing" on this opportunity to provide context and the text editor will fall back to other mechanisms.

.NET Framework Security

See Also

Reference

IVsLanguageContextProvider Interface

Microsoft.VisualStudio.TextManager.Interop Namespace