How to: Create a Context Bag or Subcontext Bag
Context bags are used to store attribute and keyword context related to a particular environment component, such as an editor, hierarchy, or tool window. Subcontext bags are used to store attribute and keyword context for selections or commands within one of these components. For more information, see Context and Subcontext Bags.
Use the following procedure to create a context or subcontext bag.
To create a context or subcontext bag
A pointer to the IVsMonitorUserContext interface is returned.
Call the CreateEmptyContext method to create a new context or subcontext bag.
A pointer to the IVsUserContext interface is returned.
Call the AddAttribute method to add attributes, lookup keywords, or F1 keywords to the context or subcontext bag.
If you are creating a subcontext bag, call the AddSubcontext method to link the subcontext bag to the parent context bag.