7

Possible Duplicate:
Can I customize automatic event handler generation in Visual Studio ?

Can I configure VS2010 Intellisense so that it does this:

SomeEvent += Some_Method;

instead of this:

SomeEvent += new EventHandler(Some_Method);

when adding an EventHandler via += and pressing the Shift key?

I understand that this doesn't make any difference as far as the generated IL is concerned but I personally much prefer the first version. It is easier to read and I don't have to go and fix the += / -= calls when I go and change the EventHandler type to something different.

Community
  • 1
  • 1
Patrick Klug
  • 14,056
  • 13
  • 71
  • 118
  • 2
    No option for this. It really doesn't matter which flavor you use, they produce the same IL. – Hans Passant Mar 21 '11 at 00:49
  • I wish I could suck out the underscore and get rid of the new syntax. – Ritch Melton Mar 21 '11 at 00:53
  • 1
    Duplicate of [Can I customize automatic event handler generation in Visual Studio ?](http://stackoverflow.com/questions/4471593/can-i-customize-automatic-event-handler-generation-in-visual-studio) - there is a [connect article](https://connect.microsoft.com/VisualStudio/feedback/details/632300/auto-generated-event-handlers-should-use-implicit-conversion-of-method-group-to-delegate) linked to in that question in which Microsoft have refused to fix it. – adrianbanks Mar 21 '11 at 00:53
  • thanks adrianbanks, didn't realize that this has been asked before. voted to close. – Patrick Klug Mar 21 '11 at 01:03
  • 1
    @adrian: "We're too close to releasing our service pack, maybe next version" isn't the same as refusing to fix it. It is rather unfortunate that MS Connect doesn't have a "deferred" status instead of just closing the issue. Anyway, vote it up up up. – Ben Voigt Mar 21 '11 at 02:59
  • @Ben: True, but marking as WontFix for SP1 is as good as realistically saying it won't be fixed in VS2010 (and I have already up-voted it). – adrianbanks Mar 21 '11 at 08:53

1 Answers1

2

Nope, sorry. I just go with the default behavior and then delete the extra fluff after it's stubbed out the method for me.

Robert Levy
  • 28,747
  • 6
  • 62
  • 94