Subscribe to tlhIn`toq's Blog        RSS Feed
-----

A fix for ReSharper won't reorder and #REGION

Icon Leave Comment
Anybody that has been in Visual Studio for more than a month has probably discovered that having your methods and properties all over the place, or just appending at the end of the file as you write the class, pretty much sucks. The Add-In ReSharper is wonderful and does a lot of stuff for you, including reorder of type members. But there seems to be a lot of bug reports on various sites for it not working. Hopefully this will help you get it behaving as you expect.

Two things: There is a known (but not heavily documented) condition where pre-compile conditionals (#if DEBUG for example) will stop type member reordering.
http://youtrack.jetb...3#tab=Comments]
In other words if you have #IF DEBUG then it won't reorder.

I also recently noticed that in ReSharper 8.0.1 (and probably earlier versions) that the button to revert the XML template back to DEFAULT WITH REGIONS doesn't really have any statements to include #REGION grouping. So I took a StyleCop friendly template that includes sorting and added #REGION-ing to each type member. If you select CUSTOM TEMPLATE then paste in this XML it should work.

Spoiler

0 Comments On This Entry

 

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

October 2014

S M T W T F S
   1234
567891011
12131415161718
1920212223 24 25
262728293031 

Recent Entries

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

Categories