Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: mkinnaird on July 05, 2005, 11:26:09 am

Title: C# code generation - starting scope
Post by: mkinnaird on July 05, 2005, 11:26:09 am
I am currently evaluating EA for our company as a standard UML Modeling tool and source code generator.  Everything is looking postive for this product, but I had a question regarding the source code generation:

It appears when I generate the source code, it insists on putting the starting scope of the method, class, namespace (ie the open curly brace) on the same line with the class/method/namespace definition.  

Our coding standards encourage the curly brace to start on the next line (so the closing matches with the starting).

Any way I can tell the generator to put the curly brace on the NEXT line??

Thanks in advance!
Michael.
Title: Re: C# code generation - starting scope
Post by: Eve on July 05, 2005, 03:47:25 pm
There is no option for this, but the generation is fully customisable.  You make it generate the braces on a new line by making the following changes in the code templates.

If you remove the line %PI=" "% from the namespace and class templates.  Then the line %PI=""% from the operation template.

These mean that the default PI (a newline) is used between lines of the template.

Simon