简体   繁体   English

隐藏UML类图中Visual Studio中的参数

[英]Hide parameters in UML class diagram Visual Studio

I have written an app in Visual Studio 2013. And am generating class diagram for it, by first selecting Architecure -> New Diagram -> UML Class Diagram Drag dropped classes from Architecture window to blank class diagram Now it generated class diagrams with full parameter list to operations. 我已经在Visual Studio 2013中编写了一个应用程序。通过首先选择Architecure-> New Diagram-> UML Class Diagram为它生成类图,将拖放的类从Architecture窗口拖到空白类图中现在它生成具有完整参数列表的类图进行操作。 And many of my methods have huge list of parameters. 而且我的许多方法都有大量的参数列表。 So it looks weird in the diagram. 因此,在图中看起来很奇怪。 Whenever I double click on any operation, VS takes me to the code of that method. 每当我双击任何操作时,VS都会带我到该方法的代码。 It feels good that what class diagram shows is exactly the signature of the method in actual code. 类图显示的正是实际代码中方法的签名,这感觉很好。

However I dont want parameters to be displayed in the class diagram nor I want to completely delete them. 但是我不希望参数显示在类图中,也不想完全删除它们。 For example, 例如,

if there are 3 methods in class diagrams: 如果类图中有3种方法:

+meth1(param1: int) : int 
-meth2(param1 : stirng, param2 : string) : string 
#meth3(param1 : int, param2 : float) : float 

I want some option / checkbox by which I can simply switch all those signatures to: 我想要一些选项/复选框,通过它我可以将所有这些签名简单地切换为:

+meth1() : int 
-meth2() : string 
#meth3() : float

So I dont actually want to manually delete the parameter list from the method just to hide them. 所以,我竟想从方法手动删除参数列表只是用来掩饰他们。 By that I will keep the signature INFORMATION in class diagram consistent with that in code, but just hide/show them whenever I require it. 这样一来,我将使类图中的签名信息与代码中的信息保持一致,但是只要需要时就隐藏/显示它们。

Somewhat, similar to SQL Server Management Studio where in diagram we can select whether to show or hide the data types of the column as follows: 有点类似于SQL Server Management Studio,在图中我们可以选择是显示还是隐藏列的数据类型,如下所示:

With datatype column 带数据类型列 在此处输入图片说明

Without datatype column 没有数据类型列 在此处输入图片说明

在菜单中,转到CLASS DIAGRAM->更改成员格式-> Display FullName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM