What interfaces are implemented by a class?

2019-08-14 20:18发布

I think it is a simple stuff, but I cannot find it.

Are there any easy way to know what interfaces a class implements? Directly or in its ancestor classes.

I have Visual Studio 2010 Pro without commercial addons.

Thanks.

3条回答
萌系小妹纸
2楼-- · 2019-08-14 20:51

You can see this in the Object Browser (under the "Base Types" folder). You will need to have the "Show Base Types" option checked though: enter image description here

查看更多
乱世女痞
3楼-- · 2019-08-14 21:00

Another way is to open Class View window (menu View -> Class View) and see it in a graphical representation under Base Types:

enter image description here

Also, make sure you've installed Productivity Power Tools because it allows you to see base / derived types, references, etc. through very handy interactive tool tips: enter image description here

查看更多
Melony?
4楼-- · 2019-08-14 21:01

Not exactly what you asked, but you can press F12 on a class name (right click -> Go to definition) and then just look at the class Foo : IBar line.

查看更多
登录 后发表回答