Share via


IVsUserContextUpdate.UpdateUserContext Method

Sends notification that the context is being updated. This method also clears the dirty flag from the context bag.

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

Syntax

'Declaration
Function UpdateUserContext ( _
    pCtx As IVsUserContext, _
    dwCookie As UInteger _
) As Integer
int UpdateUserContext(
    IVsUserContext pCtx,
    uint dwCookie
)
int UpdateUserContext(
    [InAttribute] IVsUserContext^ pCtx, 
    [InAttribute] unsigned int dwCookie
)
abstract UpdateUserContext : 
        pCtx:IVsUserContext * 
        dwCookie:uint32 -> int
function UpdateUserContext(
    pCtx : IVsUserContext, 
    dwCookie : uint
) : int

Parameters

  • dwCookie
    Type: System.UInt32

    [in] Parameter is not currently used.

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 IVsUserContextUpdate::UpdateUserContext(
   [in] IVsUserContext * pCtx,
   [in] VSCOOKIE dwCookie
);

When you create a context bag for an editor or designer, call AdviseUpdate and pass along a pointer to your context provider. When Update is called internally by the environment, each context bag in the active selection is updated. For each context bag that has called AdviseUpdate and has implemented IVsUserContextUpdate, the environment calls UpdateUserContext to inform the context provider that the context bag will be updated. You can use this call to change the attributes and keywords in the context bag before the update occurs.

If necessary, a context provider can provide notification that the context needs to be updated by calling SetDirty on the context bag. Using this approach, you do not need to supply the context until Update has been called.

Note

The SetDirty flag is automatically set to true whenever context is added or removed from the context bag.

.NET Framework Security

See Also

Reference

IVsUserContextUpdate Interface

Microsoft.VisualStudio.Shell.Interop Namespace