Evgeniy Miroshnichenko
Evgeniy Miroshnichenko

Reputation: 1865

How to show(reflect) “property” at UML class diagram in VisualStudio? (C#)

My purpose is, to get 'property' in generated from UML diagram code. Is there any way to mark operation in UML diagram as "property" that will say VisualStudio to generate it in code as property (not method)?

Upvotes: 3

Views: 1362

Answers (2)

Evgeniy Miroshnichenko
Evgeniy Miroshnichenko

Reputation: 1865

'Stereotype' that marks class attribute as class property in VisualStudio 2015 looks like:

enter image description here

I use VisualStudio 2015. I didn't fined opportunity to mark 'class property' manually by 'stereotype' in class frame (I mean,that I didn't fined opportunity to print 'stereotype' by hand in 'class frame').

You can setup 'stereotypes' in 'Property tab'(Maybe there is another way to do it in Visual Studio, but I didn't find it):

1) Create class 'attribute(field)' in 'class frame' using class context menu.

2) Select created attribute in class frame. Use context menu to get 'property' menu-item.

3) Choose 'stereotype' item in opened 'property tab'. Select needed value from combo-box.

enter image description here

Upvotes: 1

qwerty_so
qwerty_so

Reputation: 36295

You do that the same way as in your other question by stereotyping the method:

enter image description here

Upvotes: 3

Related Questions