Visual Studio:如何显示所有继承自基类的类? [英] Visual Studio: How do I show all classes inherited from a base class?

查看:526
本文介绍了Visual Studio:如何显示所有继承自基类的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,如何显示从基类继承的所有类?



例如,在ASP.NET MVC中有几个 ActionResult 'types - 它们都继承/实现基类 ActionResult



除非你只是知道查看 Json 是有效的 ActionResult 类型,没有办法你可以很容易找到这个信息。



在对象浏览器中有一些东西让这很容易找到?



我在Visual Studio之外的工具的建议找到这个关于各种类的信息。例如:Resharper中有什么可以帮助我?

解决方案

当然, Resharper 可以做到这一点。



只要在任何地方点击类型名称,然后在上下文菜单中选择转到Inheritor。
Go To Inheritor也可以应用于导航到覆盖的方法和接口方法的实现。对于一个接口,你可以调用查找使用高级againd,右键单击)在哪里可以找到所有扩展和实现。对于类型派生类型。
我最喜欢的功能 - 点击控制任何类型/方法导航到其声明。



我认为这是一个必须有的工具.net


In Visual Studio, How do I show all classes inherited from a base class?

For example, in ASP.NET MVC there are several 'ActionResult' types -- and they all inherit from / implement the base class ActionResult.

It looks like unless you just 'know' that View and Json are valid ActionResult types, there is no way you can easily find this information out.

Please prove me wrong.

Is there something in the object browser that makes this easy to find out?

I'm even up for suggestions of tools outside of Visual Studio to discover this information about various classes. For example: is there something in Resharper that will help me out?

解决方案

Sure, Resharper can do this. And much more.

Just right click on type name in any place and choose "Go To Inheritor" in context menu. "Go To Inheritor" can be also applied to method for navigating to overrides and an interface method's implementations. For an interface you could call "Find Usages Advanced" againd, just right click) where to find all extendings and implementations. For a type - derived types. And my favorite feature - click with holding Control on any type/method for navigating to its declaration.

I think it's a must-have tool for .net developers.

这篇关于Visual Studio:如何显示所有继承自基类的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆