代碼:
public interface Interface1
{
}
public class Class1:Interface1
{
}右擊代碼文件.cs->查看類關系圖->得到下圖:

Class1實現了接口Interface1,在Class1的類圖中,由一個棒棒糖(lollipop)來表示這種實現關系,這是UML的標準語法(the Class Designer uses standard UML notation (a "lollipop" shape) to indicate the interfaces implemented by a class)。但是Implement"也是一種特殊的繼承(Inheritance),如何讓VS2005顯示這種繼承(用一條帶空心箭頭的直線從Class1指向Interface1)?
我在網上找了一篇文章:Working with the VS 2005 Class Designer ,里面提到的方法:“You can specify that a class implements an interface by drawing an inheritance line from the class to the interface. To do this, first click the Interface shape in the Visual Studio Toolbox, click the class that implements the interface, then click the interface. ”,但是我按照他說的操作,點擊工具箱中的“Interface”->點擊Class1的類圖->點擊Interface1的類圖,完全沒有反應,相當懷疑原作者是不是寫錯了...


浙公網安備 33010602011771號