The Dynamic Help window is one of several windows Visual Studio provides specifically for navigating to Help topics. The Dynamic Help window displays links to a small subset of Help topics; the set of links displayed depends on the current context, which is the state of the Visual Studio IDE at any given point in time. In this topic, you will learn how to author your own custom guidance and create contexts so that your guidance is displayed as links in the dynamic help window.
Preparing the Help Topic
To create a sample help topic for a development team
-
In Windows Explorer, navigate to your C:\ drive and create a new folder named Guidance.
-
Create a file in the Guidance folder and name it CustomGuidance.htm. Type or paste any valid HTML content in the file, then save and close it.
Setting up Dynamic Help Topic Categories
When you select a node of your project in Solution Explorer, Visual Studio-provided help topics display in the Dynamic Help window. You could add your custom help topics to that list, but to help your development team find the custom topics, you can define a new topic category that provides a separate section for them in the Dynamic Help window.
To define a custom topic category
-
In Windows Explorer, open the following folder:
C:\Program Files\Microsoft Visual Studio .NET 2005\Common7\IDE\HTML\XMLLinks\1033
Tip |
|---|
| The folder name 1033 is the codepage/language code ID (LCID). |
-
In this folder, create a new text file and name it CustomHelp.xml.
-
In this new file, add the following:
<?xml version='1.0' encoding="utf-8" ?>
<DynamicHelp xmlns="http://msdn.microsoft.com/vsdata/xsd/vsdh.xsd">
<LinkGroup ID="customhelp" Title="Custom Help Topics" Priority="2">
<Glyph Expanded="vs:/ctxmsc_show.gif" Collapsed="vs:/ctxmsc_hide.gif/" />
</LinkGroup>
</DynamicHelp> The name of the new linkgroup in this example is customhelp, and links in this group will display in the dynamic help window under Custom Help Topics. You will learn how to add links to this group in the next procedure.\
Setting Up the Context Keywords
In the CustomHelp.xml file you need to define a topic to be associated with one or more keywords. For this example procedure, you will display the help file you created and named CustomGuidance.htm.
To associate a topic with an action
Note |
|---|
| In this case you do not need an Attributes node. For more information, see the Attributes Node subheading below. |
Custom Context Files and Displaying Help Topics
The following example shows a complete custom context file for an imaginary Templates and Policy Project.
<?xml version='1.0' encoding="utf-8" ?>
<DynamicHelp xmlns="http://msdn.microsoft.com/vsdata/xsd/vsdh.xsd">
<LinkGroup ID="customhelp" Title="Custom Help Topics" Priority="2">
<Glyph Static="vs:/ctxmsc.gif"/>
</Linkgroup>
<Context>
<Keywords>
<KItem Name="VBC" />
<KItem Name="WinUI" />
<KItem Name="Policy" />
</Keywords>
<Links>
<LItem URL="c:\Guidance\CustomGuidance.htm" LinkGroup="customhelp">WinUI Development Notes</LItem>
</Links>
</Context>
</DynamicHelp> Attributes Node
Although it is not shown above, you can add a node to your own context file that enhances the level of control over the contents of the Dynamic Help window. AItem entries in an Attributes node limit the list identified by Keywords to only those that contain all specified AItem entries. AItem entries correspond to ContextAttribute nodes defined in the .vspolicy file. A typical Attributes node would be inserted in the preceding example in the following manner.
<?xml version='1.0' encoding="utf-8" ?>
<DynamicHelp xmlns="http://msdn.microsoft.com/vsdata/xsd/vsdh.xsd">
<LinkGroup ID="customhelp" Title="Custom Help Topics" Priority="2">
<Glyph Static="vs:/ctxmsc.gif"/>
</LinkGroup>
<Context>
<Keywords>
<KItem Name="VBC" />
<KItem Name="WinUI" />
<KItem Name="Policy" />
</Keywords>
<Attributes>
<AItem Name="DevLang" Value="VB" />
<AItem Name="DevLang" Value="VC" />
</Attributes>
<Links>
<LItem URL="c:\public\CustomWinUI.htm" LinkGroup="customhelp">WinUI Development Notes</LItem>
</Links>
</Context>
</DynamicHelp> Attributes provide a mechanism to display topics in the Dynamic Help window that are particularly pertinent to a specific Element. If you are working within a large help system in which the same keyword is used to pull in topics that do not apply to your particular project, using the Attributes node can be very helpful. In the example above, you might want to create a help topic that applies only to the projects that are developed in either Visual Basic or Visual C++ ("VB" and "VC" above, respectively). If the topic only applies to Visual Basic and you have other developers working in languages that would have no interest in a Visual Basic topic, identifying "VB" in an Attributes node would provide a way to eliminate information that non-Visual Basic developers would find unnecessary.
Attributes provide a mechanism for differentiating between Help topics when those topics share one or more common keywords. This is particularly useful when you associate Help topics with the F1 key. For more information, see How to: Provide F1 Help for Visual Studio Templates and Policy.
See Also