IVsUserContext.AdviseUpdate Method

Enables clients to receive notification when the Dynamic Help window is about to update based on the active context.

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

Syntax

‘선언
Function AdviseUpdate ( _
    pUpdate As IVsUserContextUpdate, _
    <OutAttribute> ByRef pdwCookie As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsUserContext
Dim pUpdate As IVsUserContextUpdate
Dim pdwCookie As UInteger
Dim returnValue As Integer

returnValue = instance.AdviseUpdate(pUpdate, _
    pdwCookie)
int AdviseUpdate(
    IVsUserContextUpdate pUpdate,
    out uint pdwCookie
)
int AdviseUpdate(
    [InAttribute] IVsUserContextUpdate^ pUpdate, 
    [OutAttribute] unsigned int% pdwCookie
)
abstract AdviseUpdate : 
        pUpdate:IVsUserContextUpdate * 
        pdwCookie:uint32 byref -> int 
function AdviseUpdate(
    pUpdate : IVsUserContextUpdate, 
    pdwCookie : uint
) : int

Parameters

  • pdwCookie
    Type: System.UInt32%
    [out, retval] Unique identifier for the referenced event sink. This value is required to unadvise the event sink using UnadviseUpdate.

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 context.idl:

HRESULT IVsUserContext::AdviseUpdate(
   [in] IVsUserContextUpdate * pUpdate,
   [out, retval] VSCOOKIE * pdwCookie
);

When you create a context bag on an editor, call IVsUserContext.AdviseUpdate and pass along a pointer to your context provider. When Update is called internally by the environment, the Dynamic Help window goes through each context bag in the active selection synchronously and retrieves context from any context bag and associated subcontext bag that is flagged as dirty using the SetDirty method. However, if the context bag is on an editor window that has called IVsUserContext::AdviseUpdate and has also implemented the IVsUserContextUpdate interface, then the environment calls UpdateUserContext to inform the context provider that the context bag will be updated (that is, Update will be called). You can use this call to change the attributes and keywords in the context bag before the Dynamic Help window update occurs. For more information, see Providing Context for an Editors and Designers.

To disable notification of user context updates, call UnadviseUpdate.

.NET Framework Security

See Also

Reference

IVsUserContext Interface

IVsUserContext Members

Microsoft.VisualStudio.Shell.Interop Namespace