Share via


How to: Add a Port Shape to a Domain-Specific Language Definition

You can use port shapes to specify how link connection points on domain classes appear in a generated designer. For more information, see Port Shape (Domain-Specific Language Designer).

After you create and define a port shape, you can map it to a domain class. For more information, see How to: Add a Domain Class to a Domain-Specific Language Definition and How to: Map Elements By Using the Diagram Element Map Tool.

The Components Diagram sample demonstrates the use of port shapes. For more information, see Components Diagram Sample.

To add a port shape to a domain-specific language definition

  1. In the Toolbox, on the Dsl Designer tab, drag a port shape onto the diagram surface of the Domain-Specific Language Designer.

    A port shape that is named Port1 is created on the designer definition under the Diagram Elements swimlane.

  2. Optionally, add decorators, such as text and an icon, to the port shape. For more information, see How to: Add a Decorator.

  3. Optionally, add domain properties to the port shape. For more information, see How to: Add a Domain Property.

  4. Set any properties in the Properties window. For example, you can change the default value of the Geometry property from rectangle to circle and the Outline Color property from black to green.

  5. Map the port shape to the domain class or named domain class by using the Diagram Element Map tool. For more information, see How to: Map Elements By Using the Diagram Element Map Tool.

    When you map the port shape, make sure that the path points to the domain class that is mapped to the parent shape.

  6. Create a toolbox element tool using the DSL Explorer. For more information, see How to: Add an Element Tool.

  7. Click Transform All Templates in Solution Explorer.

  8. On the Build menu, click Rebuild Solution to start a Visual Studio experimental build to display how the port shape has been defined and mapped to a domain class.

See Also

Concepts

Domain-Specific Language Designer Terminology Overview

Defining Diagram Elements

How to: Add a Port (DSL Explorer)

Domain-Specific Language Tools Glossary