Creates better default names for event handling methods in the WinForms designer, WebForms designer and Code editor. Specify names with simple patterns. Optionally simplify event handler setup by using delegate inference.
Fantastic extension. I've always hated how Studio named event handlers. Can't believe I didn't think of making this extension myself. My only advice is to not have the drop downs all written in Pascal case, write them in their own style...
No Change lowercase UPPERCASE lowerCamelCase PascalCase
Sorry, I haven't updated yet, and don't have time to do so right now. If you're feeling adventurous you can try updating yourself:
1. Download the vsix file.
2. Rename it to .vsix.zip
3. Extract the file extension.vixmanifest
4. Open it with a text editor
5. Copy the <VisualStudio Version="11.0"> tag and its contents, and add a new one like except <VisualStudio Version="12.0">
6. Put the file back in the zip, rename back to .vsix and install.
That should do it. When I get some time I'll try to do it myself and test it in VS2013 to make sure it still works.
I try to use the "Use delegate inference" but when the suggested name by visual studio for the EventHandler has more than just the name of the EventHandler, the code generated is not correct.
Example: I try to attach an event to the ToolClick event of the Infragistics toolbar. When I call my toolbar like that: _toolBar.ToolClick += ... the popup of Visual Studio to complete the instruction is "New Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(_toolbar_ToolClick)
Because the suggested code by visual studio have the namespace before the EventHandler, when I press Tab 2 times, the result looks like that:
_toolbar.ToolClick += new Infragistics.Win.UltraWinToolbarsOnToolClick;
_toolbar.ToolClick += OnToolClick;
but the generated method is correct.
I tried with a lot of cases and the problem is just when in the suggested code by visual studio, there is a namespace before the EventHandler name.
Glad you like it. No, there is no way to change the accessor of the generated method. I hook into what happens before it is generated. I'm working on 2-3 other pet projects right now so I won't be adding the feature myself, but if you want to add the feature yourself it probably wouldn't be a big change, you can fork on github (https://github.com/einaregilsson/EventHandlerNaming) and send a pull request.
Is there any chance you could add a list of keyword to filter out of the name ?
I tend to use the following prefix("ux") for most of my user controls and so the name of the event would come out as UxSomeButton_Click so currently I have to change it for every single event.
So I think that having some sort of black list that we could add names to filter out of the actual event name would be quite useful.
e.g. UxSomeButton_Click => SomeButton_Click
Sure, I've actually thought about something similar myself, since I often use txtSomething, lblSomething etc. as prefixes for controls. I'll look at it sometime soon and publish a new version when it's done.
Well, it took a while but your suggestion is implemented in version 1.2. Unfortunately because of the (admittedly pretty stupid) way I was storing settings you'll lose you settings in the update so you'll have to configure it again but this won't happen in future versions. By default I remove all the prefixes I tend to use for controls, txt;grp;lbl;cbo etc. But you can configure it any way you need.