Navigation: CodeStencil > Expanders |
Expanders are a very important piece in the architecture of CodeStencil. They form a repository of labels and the strings defined to replace those labels during code generation.
You can define as many labels as you want to use for string replacement.
Expanders consist mainly of:
•Expansion Label - This is the label you insert in your stencil
•Expansion String - Replacement string
•Delimiter - Character to delimit multiple strings
Using Expanders |
Here is a quick example of using Expanders:
(a) We want to Expand a label called "NameSpace". This will expand into "ZeraSystems.CodeStencil". (b) Drag a label from the Expanders Grid and drop into the Code Editor. Note that the Expansion Label is automatically enclosed with "[%%] (c) Generate the code to see the string replacement in the generated file.
Code Nanites are also used the same way. The only difference is that during code generation, the actual code is called and executed. This code can be anything from generating more complicated strings or even uploading a file to FTP.
|