What is the customization file?

Modelio C# Designer uses a specific XML file to define the mapping of base types and containers.
These packages are found in the "CsCustomizationFile" XML file, located in the module’s installation directory (<Project_Path>/mda/CsDesigner/res/custom/).

Mapping model types

You can modify basic type mapping in order to generate your own custom type. The following is an example of type definition from the customization file:

1
2
3
4
  <ModelType name="boolean">
    <CsType name="bool">
    <wrapper name="Boolean"/>
  </ModelType>
  • ModelType: the base type in Modelio.

  • CsType: the corresponding C# primitive type or class.

  • Wrapper: the C# primitive type or class to use if the "wrapper" property is set on the model.

Container generation

In the same part of the customization file, default container can also be specified, for multiple cardinalities. These containers are automatically generated if no container is defined on an element, such as an Attribute, an AssociationEnd or a Parameter. For example:

1
2
3
4
5
6
7
   <AssociationEnd card="MandatoryMultiple">
    <defaultInterfaceContainer name="List">
      <import name="System.Collections.Generic"/>
    </defaultInterfaceContainer>
    <defaultImplementationContainer name="List">
      <import name="System.Collections.Generic "/>
    </defaultImplementationContainer>

This definition contains two parts: * The default interface container for an AssociationEnd with a n.. multiplicity is List, with a specific import. * The default implementation container for an AssociationEnd with a n.. multiplicity is List, with a specific import.

Note: You can use "Array" if you do not want specific collections to be generated.