Just a word of warning, that search does not find class members so it will miss:

private Button _button = new Button();

however when using the designer they are initialized inside a method so R# will find them. You can do a different search to find any _expression_ that is 'new Button()' but it returns duplicate results(msg me if you want to know how)

If I was going to do what you're doing I *would* use Find/Replace that comes with Visual Studio and then use r# to check whether I missed any.



On 29/04/2011 3:01 PM, Anthony wrote:

That excites me J   thanks Wallace!

 

From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Wallace Turner
Sent: Friday, 29 April 2011 4:12 PM
To: ozDotNet
Subject: Re: Is it possible to override a class?

 

The find/replace method is OK but Resharper can go one better. Consider these three instantiations ofButton

_button1 = new System.Windows.Forms.Button();
_button2 = new Button();
_button3 = new DumbAlias.Button();

So its likely you'll find all instances declared like _button1. If you remember you'll look for instances like _button2. It's likely you'll miss _button3.

Use Resharper to find them all in one go. Resharper -> Find -> Search With Pattern

Then enter the following pattern




Click Find and you should see



Now if that doesn't excite you what does ?!



Reply via email to