Share via


Active Context

The Visual Studio IDE can contain many context bags for all tool windows, editors, language services, hierarchies, and other context providers. A context provider is any editor, language service, hierarchy, or a similar element that implements the IVsUserContext interface. However, the Dynamic Help window only receives context from a subset of context bags associated with the active context providers. A context provider is active if it is selected. Therefore, the active context consists of the context bags, and any associated subcontext bags, for the current solution, hierarchy, hierarchy item, editor or designer, and the one tool window that has focus.

The selection service of the IDE receives notification of events that tell it which hierarchy, editor, tool window, or a similar element is currently active through various mechanisms in the IDE. When the current selection changes through user action, the selection service notifies listeners in the IDE, including the context service. The context service, in turn, checks each component in the active selection to determine whether the component has a context bag. Any selected item that provides context is added to the active context collection.

See Also

Concepts

Context and Subcontext Bags

Reference

IVsUserContext

Other Resources

About Context-Sensitive Help