Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy/Cut collapsed code and have it collapsed when pasted

When I copy or cut collapsed code and paste it somewhere else, the code gets expanded. Is there any way to make Visual Studio to retain the collapse/expand state when copy/cut/pasted?

I'm hoping that I can rearrange methods order quickly by cutting and pasting while all the implementaion details are nicely collapsed.

I'm working on VS2008 (C#) right now, but any tip on VS2010 is also appreciated.

like image 356
Kei Avatar asked Nov 09 '10 12:11

Kei


1 Answers

I don't know of doing what you are asking, but if you currently use Resharper (or are interested in trialing or buying it) then it includes a File Structure window in which you can easily change the order of class members, classes themselves and regions simply by dragging them around.

In addition it adds keyboard shortcuts for moving whole methods up and down within a type.

Beyond these simple rearrangement functions, it also has a wealth of refactorings for moving methods within the type hierachy, extracting interfaces, &c.

like image 143
Paul Ruane Avatar answered Oct 10 '22 10:10

Paul Ruane