You generate C# source files from the classes and interfaces of a model. A separate file, with the file extension .cs, is generated for each class or interface that you select from the model, along with a generation log file.
During C# generation, each main object (class, interface, and so on) generates a source file with the .cs extension. Inner classifiers are generated in the source of the container classifier.
The using directive can appear at the beginning of the script of each generated file.
In PowerDesigner, you can define a using directive in the Script\Imports tab of the property sheet of a main object. You can type the using statement or use the Import Folder or Import Classifier tools in the Imports tab.
The following PowerDesigner variables are used in the generation of C# source files:
Variable |
Description |
---|---|
CSC |
C# compiler full path. For example, C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\csc.exe |
WSDL |
Web Service proxy generator full path. For example, C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe |
To review or edit these variables, select Variables category.
and click the
Option |
Description |
---|---|
Generate Web Service C# code in .ASMX file |
Generates the C# code in the .ASMX file |
Generate Visual Studio .NET project files |
Generates the files of the Visual Studio .NET project. A solution file is generated together with several project files, each project corresponding to a model or a package with the <<Assembly>> stereotype |
Generate object ids as documentation tags |
Generates information used for reverse engineering like object identifiers (@pdoid) that are generated as documentation tags. If you do not want these tags to be generated, you have to set this option to False |
Visual Studio .NET version |
Indicates the version number of Visual Studio .NET |
For information about customizing the files that will be generated, see "Templates and Generated Files" in Chapter 3, Extending Your Models with Profiles in Customizing and Extending PowerDesigner .
Task |
Description |
---|---|
Compile C# source files |
Compiles the source files |
Generate Web service proxy code (WSDL) |
Generates the proxy class |
Open the solution in Visual Studio .NET |
If you selected the Generate Visual Studio .NET project files option, this task allows to open the solution in the Visual Studio .NET development environment |
When generation is complete, the Generated Files dialog opens, listing the files that have been generated to the specified directory. Select a file in the list and click Edit to open it in your associated editor, or click Close to exit the dialog.