2

How do I expand or collapse all the regions in a project using Visual Studio 2008?

How can I collapse all #regions and methods in c#?

Non of these works. I want to collapse only and only regions in entire project.

  • Ctrl+M, Ctrl+M : collapses single expansion.

  • Ctrl+M, Ctrl+L : collapses everything in single file.

  • Ctrl+M, Ctrl+P : disable collapse tool

  • Ctrl+M, Ctrl+M : collapses documentations in single file.

Non of these are appealing to me. first I want collapsing to affect entire project. also I want to collapse only regions strictly defined by #region directive and nothing else.


https://stackoverflow.com/a/42852157/4767498

This answer solved the collapsing region problem, (thanks to @WaiHaLee for mentioning it). But I want this effect for entire project.

M.kazem Akhgary
  • 18,645
  • 8
  • 57
  • 118
  • ok, how do I make it work for entire project? I have over 300 cs files in my project. I love simplicity, so every time I explore a cs file, I can always see minimal view. @WaiHaLee – M.kazem Akhgary Feb 06 '18 at 09:26
  • The bottom line of the duplicate is: there is no such option in the IDE. You have to resort to extensions to do that stuff. There are tons of them, but I doubt any one does do what you need. – Patrick Hofman Feb 06 '18 at 09:27
  • @PatrickHofman thanks. one quick question. where does this collapse information lie? if I know where its stored maybe I can do it my self. – M.kazem Akhgary Feb 06 '18 at 09:29
  • 1
    I think it is in the `.vs` folder, next to your solution. The format in there isn't really accessible as far as I know. You can write an extension to do so though. I guess that is easier. – Patrick Hofman Feb 06 '18 at 09:30
  • @PatrickHofman great! deleting `.vs` folder and reset worked like a charm! exactly what I want. but it causes lots of extra work to do all the caching. I just have to find specific file related to this, to make required work minimal. – M.kazem Akhgary Feb 06 '18 at 09:37

0 Answers0