Modeling a C# event in a model (C# code)
A C# event is modeled through a Modeler Attribute.
To model a C# event in a model:
1. In the model, right-click the Class, Data Type, Interface or Signal that models the element that is to own the event, point to New, and then click Attribute.
2. Type the name of the event.
3. Apply the «C# Event» stereotype to the Attribute.
4. On the Attribute's Property Pages, click the C# Event tab.
5. Set the tagged value of the C# Delegate Type tag definition to the Operation that generates the delegate that is associated with the event.
6. Set the tagged values of the other Tag Definitions as required.
|
ACS generates an event only after tagged values are set for both the C# Add Accessor Body and C# Remove Accessor Body tag definitions.
|
7. If you want to specify a default value for the event, on the Data Type tab, in the Default box, type the default value.