C# Options - Model

If you intend to generate C# code from your model, you can configure the model-specific code generation options using the 'C# Specifications' page of the 'Manage Project Options' dialog to:

  • Specify the default file extension
  • Indicate additional Collection Classes - to define custom Collection Classes, which can be simple substitutions (such as CArray<#TYPE#>) or a mix of other strings and substitutions (such as Cmap<CString,LPCTSTR,#TYPE#*,#TYPE#*>); these Collection Classes are defined by default:
         -  List<#TYPE#>;Stack<#TYPE#>;Queue<#TYPE#>;
  • Set the Statemachine Engineering options
  • Specify the Collection Class definitions for Association connectors

Access Project | Settings | Project Options | Source Code Engineering | C#




See also

Options for the current model

Type in the default file extension to apply when generating C# source code, and a list of any additional Collection Classes you want to define.

Example Use of Collection Classes

Statemachine Engineering

In the value fields, use the drop-down arrows to set the options to True or False; these options apply to generating code from State Machine models in the current model only:

  • 'Use the new Statemachine Template' - set to True to use the code generation  templates from Enterprise Architect Release 11 and later, set to False to apply the EASL Legacy templates
  • 'Generate Trace Code' - set to True to generate Trace code, False to omit it

Legacy State Machine Templates

Collection Classes

Click on this button to open the 'Collection Classes for Association Roles' dialog, through which you specify the collection class definitions for Association connectors.

Collection Classes


  • These options affect all users of the current model; however, they do not apply to other models

Learn more