Defining Domain Enumerations and External Types

You can add domain enumerations to a domain-specific language. They are displayed in the DSL Explorer under Domain Types.

Adding a Domain Enumeration

Add a domain enumeration to the model by right-clicking the root of the model in the DSL Explorer, and then clicking Add New Domain Enumeration. In the Properties window, set the name of the enumeration and the namespace to which it belongs. Add enumeration literals to the enumeration by right-clicking the domain enumeration, and then clicking Add New Enumeration Literal. In the Properties window, set the name and value of each new enumeration literal.

Flags

Domain enumerations that have bit fields rather than integer values should be marked as Flags. In the Properties window, set the IsFlags property to True. When you set a domain property to a Flags enumeration type, the generated model designer will display a drop-down list on this property. The list shows the available bit fields so that a user can select a set of bit fields as the value.

Adding an External Type

If you do not find a type in the Type drop-down list, you can add an external type. For example, you can add the System.Drawing.Color type to the list of types by right-clicking the root of the model in the DSL Explorer, and then clicking Add New External Type. In the Properties window, set the name to Color and the namespace to System.Drawing. This type should now appear in the DSL Explorer under Domain Types, and should be displayed in the Type list in the Properties window.

See Also

Other Resources

Domain-Specific Language Tools Glossary

Change History

Date

History

Reason

July 2008

Rewrote and refactored project.

Content bug fix.