Redundant new instance of delegate on event subscribe

var1.Click += new EventHandler(var1_Click);
^
this is redundant, I think, in .net 2.0

4 comments
Comment actions Permalink

Usually, yes.

There are some rare cases where the delegate name is not redundant - when
compiler can't select proper method from method group

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Airex" <airex.s@gmail.com> wrote in message
news:op.s8a697toyg18dx@w-skachkovsky...
var1.Click += new EventHandler(var1_Click);
^
this is redundant, I think, in .net 2.0


0
Comment actions Permalink

On Thu, 20 Apr 2006 16:50:03 +0300, Eugene Pasynkov (JetBrains)
<Eugene.Pasynkov@jetbrains.com> wrote:

Usually, yes.

>

There are some rare cases where the delegate name is not redundant - when
compiler can't select proper method from method group

>

Maybe, you should allow R# to clear this redundant on File Formating?

--
?????????? M2, ????????????? ???????? ?????????? Opera:
http://www.opera.com/mail/

0
Comment actions Permalink

Please could you submit corresponding request to our tracker?
This will likely be done in 2.X

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Airex" <airex.s@gmail.com> wrote in message
news:op.s8a7q3d4yg18dx@w-skachkovsky...
On Thu, 20 Apr 2006 16:50:03 +0300, Eugene Pasynkov (JetBrains)
<Eugene.Pasynkov@jetbrains.com> wrote:

Usually, yes.

>

There are some rare cases where the delegate name is not redundant - when
compiler can't select proper method from method group

>

Maybe, you should allow R# to clear this redundant on File Formating?

--
ïÔÐÒÁ×ÌÅÎÏ M2, ÒÅ×ÏÌÀÃÉÏÎÎÏÊ ÐÏÞÔÏ×ÏÊ ÐÒÏÇÒÁÍÍÏÊ Opera:
http://www.opera.com/mail/


0
Comment actions Permalink

Hello Eugene,

Please could you submit corresponding request to our tracker? This
will likely be done in 2.X

There's already such a request in your tracker.

Regrads,
Maxim


0

Please sign in to leave a comment.