Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.57 KB

how-to-set-clr-attributes-on-an-element.md

File metadata and controls

42 lines (28 loc) · 1.57 KB
titledescriptionms.datems.topicf1_keywordshelpviewer_keywordsauthorms.authormanagerms.subservice
Set CLR attributes on an element by using DSL Explorer
Learn how to add any attribute that inherits from System.Attribute. Custom attributes can be added to domain elements, shapes, connectors, and diagrams.
06/24/2022
how-to
vs.dsltools.EditAttributesDialog
Domain-Specific Language, custom attrributes
mgoertz-msft
mgoertz
mijacobs
modeling

Set CLR attributes on an element

Custom attributes are special attributes that can be added to domain elements, shapes, connectors, and diagrams. You can add any attribute that inherits from the System.Attribute class.

Add a custom attribute

  1. In the DSL Explorer, select the element to which you want to add a custom attribute.

  2. In the Properties window, next to the Custom Attributes property, select the Browse (...) icon.

    The Edit Attributes dialog box opens.

  3. In the Name column, select <add attribute> and type the name of your attribute. Press ENTER.

  4. The line under the attribute name shows parentheses. On this line type a parameter type for the attribute, for example, string. Press ENTER.

  5. In the Name Property column, type an appropriate name, for example, MyString.

  6. Select OK.

    The Custom Attributes property now displays the attribute in the following format:

    [AttributeName(ParameterName=Type)]

Related content

close