Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > C# code > C# code > Reverse engineering legacy C# code > Mapping information > Package mapping for C# (C# code)
  
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 Operations that are stereotyped by the «C# Delegate» stereotype, ACS generates a code file for the Package, in which code is generated for the delegate Operation. For Operation mapping information, click here Operation mapping for C# (C# code)
If the Package owns Packages, ACS generates a subfolder for each Package.
If the Package owns Signals, ACS generates a code file for each Signal. For Signal mapping information, click here Signal mapping for C# (C# code)
If the Package owns Type Definitions whose Construction is Enumeration, ACS generates a code file for Package, in which code is generated for the Type Definition. For Type Definition mapping information, click here Type definition mapping for C# (C# code)
All other Package scoped items are ignored.
Properties:
If a Description is specified and a code file is generated for the Package, ACS generates the text of a Package's Description property at the beginning of the code file. For information about how comments are generated, click here Generation of code comments (C# code)
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).