开发者

ReSharper: find derived types constructor usages points

开发者 https://www.devze.com 2023-01-01 12:43 出处:网络
I have some base class ControlBase and many derived classes which also have derived classes... Con开发者_C百科trolBase and derived classes have parameterless constructor. How can I easily find all der

I have some base class ControlBase and many derived classes which also have derived classes... Con开发者_C百科trolBase and derived classes have parameterless constructor. How can I easily find all derived classes constructor invocation points? ReSharper find usages on ControlBase constructor shows only usages of this base class constructor but not derived classes constructors.

Thanks.


You can achieve this by using the structural search feature in Resharper 5.

Go to Resharper/Find/Search with Pattern in the menu. Then enter the following pattern in the textbox on the left:

new $type$($args$)

The words enclosed by the Dollar signs are placeholders which have to be specified. You can do this by clicking on "Add Placeholder".

In your example you need a Type placeholder (name=type, Type=ControlBase, check "Or derived type") and an Argument placeholder (name=args).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号