Overview

In "roundtrip" mode and for C# 2.0 generation, the "objingid" C# attribute is generated for classes, interfaces, enumerations, attributes, associations and operations. This annotation contains the identifier of the modeling element that has been generated.

1
2
3
4
5
6
7
  [objingid("13636872:26967")]
  public class Class
  {

    //code ...

  }

The "objingid" C# attribute is used to find the modeling element in the Modelio project when it is reversed. Without it, the element is searched for by name. This makes it indispensable to update an element when it has been renamed or moved in the C# sources. For example, operations that have changed signature will be updated and not deleted, and then recreated.

Copying

When copying code in C# sources, the "objingid" C# attribute must never be copied, in order not to lose information when reversing or updating a modeling element that does not correspond to the C# code.

Compilation

In order to be able to compile C# sources with this new C# attribute, an "using" is generated to the file containing the declaration of the C# attribute:

1
  using Softeam.CSharp;

A "objingid.dll" archive is provided with C# module, containing the declaration of the C# attribute. To be able to compile outside Modelio, you must add this library. If you generate a MakeFile from Modelio, the library is added automatically.