Confused about: Redundant explicit delegate creation for method

So, I understand the error, I have found a couple posts that suggest ways to avoid getting the error:

http://www.intellij.net/forums/thread.jspa?messageID=5191278&#5191278
http://www.intellij.net/forums/thread.jspa?messageID=5095238&#5095238

But I am confused. I am using Resharper in what I feel is the "Normal" way: I type something like

uxSomeButton.Click +=

Then resharper works it's magic and generates the new method and extends my line to

uxSignIn.Click +=new EventHandler(uxSignIn_Click);

It immediately highlights the code that IT just generated with a warning?

Am I doing something wrong?

4 comments
Comment actions Permalink

AFAIK, the TAB-TAB behaviour is part of Visual Studio, not R#. A very elegant way to create a handler method is R#'s smart completion functionality. Type
uxSomeButton.Click +=
then hit the smart completion hotkeys and select "Create anonymous delegate for xxx" or "Create new method for xxx".

Regards,
Andre

0
Comment actions Permalink

Very cool - looks like I was just using the tools wrong. Thanks for the tips.

0
Comment actions Permalink

Whats the hotkey? ;9

0
Comment actions Permalink

Rdrunner wrote:

Whats the hotkey? ;9


CtrlShiftSpace

--
Peter Sulek
terrorix@centrum.sk
XanaNews ver. 1.18.1.6

0

Please sign in to leave a comment.