Visualizing and editing generated code
Visualizing generated C# code
C# code can only be visualized for work products which have an associated .cs file, in other words, for work products whose class code has been generated.
To visualize generated C# code, carry out the steps shown in Figure 13.

Figure 13. Running the "Visualize" command
Steps:
· Select the "BankAccount" class in the explorer.
·
Click on the
“Visualize” icon in the toolbar.
Note: Generated C# code can also be visualized by running the "C# Developer/Visualize the code" command from the context menu on a C# generation work product.
A window containing the generated C# code (shown in Figure 14) then appears. The code itself cannot be modified directly in this window, but some elements can be modified from the model. These elements are highlighted in blue. Double-clicking on the blue text opens the dialog box of the model element in question, where the element can be redefined.

Figure 14. Window displaying the C# code of the "BankAccount" class
Steps:
1. Click on the blue "Bank" text.
2. The dialog box for the "Bank" package then opens.
3. Make your modifications and confirm by clicking on the "OK" button.
Editing generated C# code
It is also possible to edit the C# code generated for a class, using the external editor specified at C# Developer parameter level (the "Command for invoking external editor" parameter in the "External edition" parameter set).
Zones represented between markers can then be modified. Modifications are directly incorporated into the model when the editor is closed.

Figure 15. Editing the generated code using an external editor
Steps:
1. In the explorer, right-click on the C# work product belonging to the "BankAccount" class.
· From the context menu, run the "MDA components/C# Developer/Edit" command.
· The code is then edited in the external editor which has been specified at C# Developer parameter level.