ReSharper conventions for names of event handlers

前端 未结 4 1100
小鲜肉
小鲜肉 2020-11-29 01:23

When I add new event handler for any event, VS creates method like object_Click. But ReSharper underlines this method as Warning, because all methods should no

4条回答
  •  感动是毒
    2020-11-29 01:51

    I just created an extension for Visual Studio 2010, EventHandler Naming, that lets you specify with a simple pattern what you want your generated eventhandler names to be. The default pattern in the extension is On$(SiteName)$(EventName) which will give you event names like OnBtnNameClick instead of btnName_Click. You can get the extension at http://tech.einaregilsson.com/2010/12/22/better-eventhandler-names-in-visual-studio-2010/

提交回复
热议问题