Search code examples
c#visual-studiorefactoringresharperregion

Resharper 7: Sort Method by name, within a #Region


I am trying to sort the methods by name that are in a class in a #region, is there a way?

#Region ABCD
   public void XYZ(){}
   public void ABC(){}
#EndRegion

Becomes:

#Region ABCD
   public void ABC(){}
   public void XYZ(){}
#EndRegion

Only those in the region (or if I have to, highlighted text) get sorted.


Solution

  • I'm not 100% sure but there is an option on ReSharper-->Tools-->Cleanup Code-->Reorder type members

    enter image description here