Telerik® JustCode™ comes with a number of predefined templates to insert or surround existing code with common data structures and statements.
To learn about code templates take a look at the Code Templates topic.
In the general dialog you can enable whether to use code completion for templates via the Enable Code Templates check box.
Unchecking it will prevent template completion from keyboard using the acronym and the expansion hotkey.
However, if the Show Code Templates in the Visual Aid menu check box is enabled the templates will be visible in the Visual Aid Code Generation (Alt + End) window and will be available for use from there.
Of course Expand Code Template Acronym command will be always available.
Show suggestions in Code Templates setting allows JustCode to provide variable suggestions for the template variable names and types according to context.
Acronym Expansion Hotkey section provides the available options for a hotkey. The default one is set to Shift + Space.
Import / Export Code Templates functionality allows users easily to transfer their templates and import new ones from a file. Exported file is in xml format with simple syntax which allows easily editing.
To import a template from a file, all you have to do is to provide correct file and keep the syntax as shown in the following examples.
The only difference in the examples is the tag that specify the language type.
Beware that any additional interval or new line in the CDATA definition of the template will affect in the final result of the template.
There are six types of languages with available template support :
C# specified by the <CSharpCodeTemplates> tag
VB.NET specified by the <VBCodeTemplates> tag
HTML specified by the <HtmlCodeTemplates> tag
CSS specified by the <CssCodeTemplates> tag
LESS specified by the <LessCodeTemplates> tag
There is a preview window when a template is selected. Read more about Code Templates here.
In case you want to make a new template just click the New drop down menu and choose a type for it. There are two types so far :
The following dialog will appear:
It provides you with the ability to set the acronym, description, text of the template and its availability.
Clone and Edit provide the same window but with filled fields in it.
Export button provides a dialog for selecting the exported file destination.