The ActiveSnippet Configuration can be accessed by selecting the ActiveSnippet Configuration menu item located in the Visual Studio Generator sub-menu. The ActiveSnippet Configuration dialog allows you to Add, Remove, Edit or view all ActiveSnippets, Once you've created a template for usage as an ActiveSnippet, you must add the ActiveSnippet which maps to a CodeSmith Generator Template.
The first step to creating a new ActiveSnippet is to click the Add button, and use the Template Chooser Window to browse to the CodeSmith Generator template that will be serving as your ActiveSnippet. Once you select the template, you must configure at minimum the Template Options for the template.
The template options tab holds the mapping information about your CodeSmith Generator template. This information is required to allow you to have access to this template from within Visual Studio.
Template: The full path to the CodeSmith Generator template.
Configuring the arguments for an ActiveSnippet is a powerful feature because it does not force you to have to always pass all properties in for the selected CodeSmith Generator Template as arguments.
This tab is a dual pane select box which shows all template properties to the left, and all arguments to the right. Control arrows are used to move properties to and from the Arguments window. The up and down arrows are used to setup the argument order of the ActiveSnippet.
The Default Property Values tab will allow you to enter possible default values for your CodeSmith Generator Templates' Property Sheet. This will show all the properties for the ActiveSnippet based CodeSmith Generator Template.
Values that you want to be required properties for ActiveSnippet arguments would not be filled in as a default value. |