|
Adding custom code Topic updated 2-2-2007 |
|
GenWise templates define User Codeblocks where custom code can be added. This custom code becomes part of the project and is maintained through generation cycles. Most templates define a large amount of User Codeblocks, allowing you to pick the right spot to add your custom code. In most scenarios you will add your custom code only in one or two blocks, and leave the rest of them blank. The Source Editor makes a distinction between template code and your custom code. Template code is read-only, User Codeblocks can be edited. Difference of background-color clearly shows the distinction between these two types of Codeblocks. By default the template code has a yellow background-color and the User Codeblocks have a white background-color. You can change the background-color of the template code in the Source Editor Configuration.
Examples In the example below custom code has been added to a C# class method.
User Codeblocks do not necessarily take a whole line in the Source Editor. This can be seen in the following example where an attribute has been added to an ASP.NET Label control. Notice that the text "Search" of the label is part of the template code. It can't be edited in the Source Editor, but it can be changed through the template configuration. Notice also that you might add text or html tags before and after this text.
|