Condividi tramite


IVsTextMarkerContextProvider.UpdateContextForMarker Method

Called by the language service to indicate that the context for a text marker should be added to the context bag.

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

Syntax

'Dichiarazione
Function UpdateContextForMarker ( _
    dwReserved As UInteger, _
    pUC As Object _
) As Integer
int UpdateContextForMarker(
    uint dwReserved,
    Object pUC
)
int UpdateContextForMarker(
    unsigned int dwReserved, 
    Object^ pUC
)
abstract UpdateContextForMarker : 
        dwReserved:uint32 * 
        pUC:Object -> int 
function UpdateContextForMarker(
    dwReserved : uint, 
    pUC : Object
) : int

Parameters

  • dwReserved
    Type: System.UInt32
    Unused parameter. Must be set to nulla null reference (Nothing in Visual Basic).
  • pUC
    Type: System.Object
    Pointer to the context bag on the Visual Studio core 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 IVsTextMarkerContextProvider::UpdateContextForMarker(
   DWORD dwReserved,
   IVsUserContext *pUC
);

The core text editor calls IVsTextMarkerContextProvider.UpdateContextForMarker at the same time that it updates other context. The TextMarker object should implement this method and add a keyword and/or attributes to the given context bag that is specific to the text marker (probably a squiggly).

If a marker has the MV_CONTEXT_CONTRIBUTION_FOR_BODY style set, its client will be QueryInterfaced for this interface.

.NET Framework Security

See Also

Reference

IVsTextMarkerContextProvider Interface

Microsoft.VisualStudio.TextManager.Interop Namespace