Ian Vink
Ian Vink

Reputation: 68830

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.

Upvotes: 4

Views: 1736

Answers (2)

Soner Gönül
Soner Gönül

Reputation: 98868

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

enter image description here

Upvotes: 4

dutzu
dutzu

Reputation: 3920

try using CTRL-ALT-F i think, Code Cleanup. It will provide you with 2 default profiles that among other things will sort methods for you. You can define a profile that will suit your needs.

Upvotes: 1

Related Questions