Package mapping for C# (C# code)
For each Package, ACS generates a subfolder. In addition, ACS generates a code file for a package when that Package scopes directly a Class, Data Type or Interface that is set up as parent file scoped, an Operation that is set up as a delegate, or a Type Definition whose construction is Enumeration.
ACS generates the child items, properties and tagged values of a Package as follows.
Child items:
• If the Package owns
Classes, ACS typically generates a code file for each Class. If an owned Class has its C# Parent File Scoped tag definition set to true, ACS does not generate a code file for the Class and the class is defined in the code file that is generated for the Package. For Class mapping information, click here
Class mapping for C# (C# code) • If the Package owns
Data Types, ACS typically generates a code file for each Data Type. If an owned Data Type has its C# Parent File Scoped tag definition set to true, ACS does not generate a code file for the Data Type and the struct is defined in the code file that is generated for the Package. For Data Type mapping information, click here
Data type mapping for C# (C# code) • If the Package owns
Interfaces, ACS typically generates a code file for each Interface. If an owned Interface has its C# Parent File Scoped tag definition set to true, ACS does not generate a code file for the Interface and the interface is defined in the code file that is generated for the Package. For Interface mapping information, click here
Interface mapping • If the Package owns Packages, ACS generates a subfolder for each Package.
All other Package scoped items are ignored.
Properties:
• If the Mapping property of a Package is set to Namespace, ACS generates the Package as a subfolder and the Package is treated as a namespace. If ACS generates a code file for a namespace Package, a namespace declaration is generated in that code file.
If you want to generate a namespace without the subfolder, use the C# Namespace tag definition (see the Tag Definitions section that follows).
• ACS generates the Name property of a Package as the name of the subfolder, and if generated, the name of the code file and namespace.
| ACS may modify the package name that is used for the subfolder, code file or added to the code to make it valid for C#. You can specify the exact package name to use for the subfolder, code file or namespace through the CODE_GENERATION_NAME property of a Package.
Tell me more... |
• The Visibility property of a Package is ignored.
Tag Definitions:
The «C# Package» stereotype applies the following Tag Definitions to a Package:
• If a tagged value is specified for the C# Extern Alias Directives tag definition, ACS generates the value at the beginning of the code file that is generated for the Package (after the Package Description, if generated).
• The tagged value of the read-only C# File tag definition is used for opening generated code files from Modeler. This value is set by ACS.
| The tagged value of the derived C# File tag definition is stored in your computer's registry (not the model) – the path and file name you see does not apply to other users of the model. |
• If the tagged value of the C# Namespace tag definition is set to Namespace Only (and the Mapping property is set to Namespace), ACS generates a namespace without generating a sub folder for the Package.
If the tagged value of the C# Namespace tag definition is set to Namespace & Folder (and the Mapping property is set to Namespace), ACS generates a namespace and subfolder for the Package.
| If the Package's Mapping is set to Folder, ACS does not generate a Namespace for the Package, irrespective of how the tagged value of the C# Namespace tag definition is set. |
• If a tagged value is specified for the C# Using Directives tag definition, ACS generates the value at the beginning of the code file that is generated for the Package (after any extern alias directives and the Package Description, if generated).