Triggering a Configuration Form

<< >>

Navigation:  CodeStencil > Stencils > Stencil Configuration >

Triggering a Configuration Form

 

The conditions for triggering a Stencil Configuration Form are:

 

a)Configuration Folder: Create a folder that will be the first node in your Code Tree. The reason for this is so that the configuration can be triggered and updated with new values ( if any) before the rest of code generation continues. Since the nodes in the Code Tree are ordered alphabetically, an easy way to force the folder to be the first is to label it starting with a period, for example: ".Configuration".

 

CS_clip0170

 

b)Configuration Form: Create a node of type "Form" and give the Node Label the name of an existing Expander:

 

CS_clip0171

 

 

Now, as soon as you press F5 or click on the "Generate" icon on the toolbar to start code generation, once the code generation process hits the configuration node, it will pop up the configuration Form:

 

CS_clip0172

 

This gives the end user the opportunity to determine how code will be generated by the stencil.

 

To explain how this works, lets take the DevExpress ASP .NET Core Stencil as an example.

 

The generated application has a search feature at the top:

 

CS_clip0173

 

 

Now, if you don't want your generated code to have this , then all you have to do is to set this to false in the configuration form:

 

CS_clip0174

 

If you want to prevent the Configuration Form from popping up on every code generation, you can simply disable it.

 

To Disable: Right-Click , Disable

 

CS_clip0175

 

Or, if you want the configuration form active, just the first time you generate your code, you can set the node to be disabled automatically after first code generation.

 

To Disable after 1st code generation:

 

(1)Right-Click

(2)Edit

(3)Check "Disable After First Process"

 

CS_clip0176