I have a program with several methods, however, as I have added new methods, some of them are not in a logical order in their source code files. I was wondering:
I have done done some research on this and the only answer I can find is to use:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.vclinkertool.functionorder%28v=vs.80%29.aspx
But this tool uses a text document to put the methods in the desired order. Is there any easier way of doing this?
CTRL + M + O will collapse all.
Press the shortcut keys to move the line under the cursor up or down or select a block of text and press the shortcut keys to move the entire block up or down. The default shortcut keys are as follows: Alt + ↑ (Up Arrow) – Moves a line up. Alt + ↓ (Down Arrow) – Moves a line down.
This keyboard shortcut is new in Visual Studio 2013. If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up.
I am using Resharper for Visual Studio 2015, it moves entire methods up and down with a keyboard shortcut.
ctrl + alt + shift + (up-arrow or down-arrow)
If you are just looking for a simple way to cut and paste/drag whole methods in the code editor window, you can do so with the code outlining feature in visual studio.
I've never used ReSharper before, so I can't speak to the actual functionality, but upon searching the web real quick for a better solution than the source code outlining option, I found that ReSharper may support this using their "File Structure" dialog:
http://www.jetbrains.com/resharper/features/navigation_search.html#File_Structure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With