Managing the Folder Tree
Folders may contain subfolders, templates, or both. At any time, one node in the folder tree will be selected. The selected node is indicated by a highlight. In the screenshot below, the CSLA.NET subfolder of the Frameworks subfolder of the CodeSmith Samples folder is selected. You can select a node by clicking on it with the mouse. You can also move the selection by using the up or down arrow keys, or by typing the first letter of the name of the node.
A folder that can be expanded is indicated by a plus sign to its left. To expand a folder, click the plus sign, or double-click the folder or its name, or select the folder and click the right arrow or the plus sign on the numeric keypad. A folder that can be collapsed is indicated by a minus sign to its left. To collapse a folder, click the minus sign, or double-click the folder or its name, or select the folder and click the left arrow or the minus sign on the numeric keypad.
You can perform a variety of other operations from the CodeSmith Explorer context menus. These menus differ depending on which node you right-click on.
Context Menu for a Template Folder Shortcut
Right-clicking on a template folder shortcut (top-level folder in the CodeSmith Explorer tree) brings up a shortcut menu with the following choices:
- New. This opens a sub-menu with six choices:
- C# Template. Create a new template using C# as its code-behind language.
- VB Template. Create a new template using VB as its code-behind language..
- JScript Template. Create a new template using JScript as its code-behind language
- Blank Template. Create a new template with no contents.
- New File. Create a new empty file. By default the file with have a .txt extension.
- New Folder. Create a new subfolder.
- Refresh. Refresh the CodeSmith Explorer tree from this point downwards.
- Delete. Deletes this folder shortcut from CodeSmith Explorer. This does not delete the underlying files from your hard drive.
- Rename. Lets you change the display name of the shortcut in CodeSmith Explorer. This does not change the name of the underlying folder on your hard drive.
- Sub Folders. When checked, CodeSmith Explorer will also display subfolders of the target folder. Otherwise, it will only display templates in the target folder of the shortcut itself.
Context Menu for a Subfolder
Right-clicking on a subfolder when CodeSmith Explorer is in folder view brings up a shortcut menu with the following choices:
- New. This opens a sub-menu with six choices:
- C# Template. Create a new template using C# as its code-behind language.
- VB Template. Create a new template using VB as its code-behind language..
- JScript Template. Create a new template using JScript as its code-behind language
- Blank Template. Create a new template with no contents.
- New File. Create a new empty file. By default the file with have a .txt extension. Note that the file will not be displayed in CodeSmith Explorer after it is created.
- New Folder. Create a new subfolder.
- Refresh. Refresh the CodeSmith Explorer tree from this point downwards.
- Delete. Deletes this folder shortcut from CodeSmith Explorer. This does not delete the underlying files from your hard drive.
- Rename. Lets you change the display name of the shortcut in CodeSmith Explorer. This does not change the name of the underlying folder on your hard drive.
- Exclude. Â Removes this folder and its contents from the CodeSmith Explorer display.
- Exclude Global. Removes this folder, and any others with the same name, along with their contents, from the CodeSmith Explorer display.
If you accidentally Exclude a folder, you can return it to CodeSmith Explorer by deleting the parent template folder shortcut and then re-adding the template folder shortcut to CodeSmith Explorer. This will reset all exclusions for the template folder shortcut.
There is no way to reverse the effects of an Exclude Global operation, so you need to be extremely cautious when choosing this menu item.
There is no context menu for subfolders when CodeSmith is in target language view.
Context Menu for a Template
Right-clicking on a template brings up a shortcut menu with the following choices:
- Execute. Execute the template.
- Edit. Open the template for editing
- Delete. Deletes this template from CodeSmith Explorer and from your hard drive.
- Rename. Renames this template in CodeSmith Explorer and on your hard drive.
- Exclude. Removes this template from the CodeSmith Explorer display.
- Exclude Global. Removes this template, and any others with the same name, from the CodeSmith Explorer display.
If you accidentally Exclude a template, you can return it to CodeSmith Explorer by deleting the parent template folder shortcut and then re-adding the template folder shortcut to CodeSmith Explorer. This will reset all exclusions for the template folder shortcut.
There is no way to reverse the effects of an Exclude Global operation, so you need to be extremely cautious when choosing this menu item.