IVsUserContextUpdate.UpdateUserContext Method
Sends notification that the Dynamic Help window is updating context. 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
‘선언
Function UpdateUserContext ( _
pCtx As IVsUserContext, _
dwCookie As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsUserContextUpdate
Dim pCtx As IVsUserContext
Dim dwCookie As UInteger
Dim returnValue As Integer
returnValue = instance.UpdateUserContext(pCtx, _
dwCookie)
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
- pCtx
Type: Microsoft.VisualStudio.Shell.Interop.IVsUserContext
[in] Pointer to the IVsUserContextUpdate interface (the context bag) to update.
- 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, the Dynamic Help window then goes through each context bag in the active selection synchronously. 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 Dynamic Help window update occurs.
If necessary, a context provider can notify the Dynamic Help window 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 the Dynamic Help window has signaled that it is ready to consume it, by calling Update.
참고
The SetDirty flag is automatically set to true whenever context is added or removed from the context bag.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.