This documentation is archived and is not being maintained.

UIContextGuids Class

Provides a list of GUIDs that are used to identify command contexts.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in microsoft.visualstudio.shell.interop.8.0.dll)

public abstract class UIContextGuids
public abstract class UIContextGuids
public abstract class UIContextGuids

NoteNote

This collection of GUIDs is specific to Visual Studio .Net 2003. All of these contexts are also included in the UIContextGuids80 set for later versions of Visual Studio.

A command context indicates a particular state Visual Studio is in, for example, a solution is building or debugging is active. Multiple contexts can be active at the same time, for example, a solution is loaded and the solution has multiple projects.

As contexts change, notifications are sent out to parties that have registered themselves with the SVsShellMonitorSelection service (see the AdviseSelectionEvents method). It is also possible to request the state of any context using the methods in the IVsMonitorSelection interface, which in turn is obtained from the SVsShellMonitorSelection service.

VSPackages that have user interface (UI) elements can associate those UI elements with particular command contexts. When those contexts become active or inactive, the VSPackage's associated UI elements are automatically activated or deactivated as well. The VSPackage makes this association between its own UI elements and the command contexts using the VISIBILITY_SECTION section of the Command Table Compiler (.ctc) file that is part of the VSPackage. For a list of predefined command contexts that can be used in a .ctc file, see VISIBILITY_SECTION – VISIBILITY_END. The additional contexts defined in the UIContextGuids namespace can also be used in .ctc files. However, the definition for each context must be added to the .ctc file by hand. The Remarks section for each context specifies if a predefined label exists or the Remarks section provides a definition that can be used in a .ctc file.

System.Object
  Microsoft.VisualStudio.Shell.Interop.UIContextGuids

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: