Modeling a C# finalizer in a model (C# code)
A C# finalizer is modeled through a Modeler Operation.
To model a C# finalizer in a model:
1. In the model, right-click the Class, Data Type or Interface that is to own the finalizer, point to New, and then click Operation.
2. Type the name of the finalizer.
If you do not apply the «C# Finalizer» stereotype to the Operation, the name of the Operation must match the name of the owning Class, Data Type or Interface preceded with ~.
If you apply the «C# Finalizer» stereotype to the Operation, the name of the Operation can be any valid name (do not include the tilde character in the name).
3. Set the standard properties of the Operation as required, ensuring that the Data Usage is set to On Instance.
4. If you want to specify C# specific information, such as modifiers and attributes:
a. Apply the «C# Finalizer» stereotype to the Operation.
For information about applying Stereotypes to an item, click here Applying a stereotype to a model item
b. On the Operation's Property Pages, click the C# Finalizer tab.
c. Set the tagged values of the Tag Definitions as required.
For more information about the available Tag Definitions, click here Operation mapping
For information about setting the tagged value of a Tag Definition, click here Setting a tagged value for an applied tag definition