Can Resharper refactor a control name including its event handlers?

Say I have a Windows Form and dragged a button on it. The button is called button1. I double click the button to generate its event handler. The event handler is named button1_Click.

Can Resharper help me rename the button? So if I'd rename the button to executeButton, I'd expect the event handler to also be renamed to executeButton_Click.

Also, I would expect to be able to do such refactoring from the form Designer window. The only way I've found to refactor the control is to go into the designer code and refactor the control from there. But that still doesn't rename the event handler.

2 comments
Comment actions Permalink

Hello Dick,

At the moment ReSharper doesn't suggest to rename the event handler when
the corresponding class/field gets renamed. You're welcome to add a feature
request through http://youtrack.jetbrains.net/issues/RSRP. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Say I have a Windows Form and dragged a button on it. The button is
called button1. I double click the button to generate its event
handler. The event handler is named button1_Click.

Can Resharper help me rename the button? So if I'd rename the button
to executeButton, I'd expect the event handler to also be renamed to
executeButton_Click.

Also, I would expect to be able to do such refactoring from the form
Designer window. The only way I've found to refactor the control is to
go into the designer code and refactor the control from there. But
that still doesn't rename the event handler.

---
Original message URL:
http://devnet.jetbrains.net/message/5280204#5280204



0

Please sign in to leave a comment.