"Expand All" Outlining Option?

J

jsteele

The two most frequent things I want to do with the regions I define in the
code behind a form are:

1. Collapse all regions, and
2. Expand all regions (e.g., so I can do a global edit)

I don't seem to find a way to do the latter in one stroke. Am I missing it?

Thanks

Greg Dunn
 
T

Tim Wilson

Is this something similar to what you wanted:
"Toggle All Outlining" = Ctrl + M, Ctrl + L (hold down control then hit "m"
then hit "l")
 
J

jsteele

Is this something similar to what you wanted:
<<

Similar, I suppose, but not *it*. Toggle All Outlining toggles between (a)
collapsing the entire class definition to a single entry, and (b) opening
the class definition back up, leaving individual regions collapsed or
expanded as they were before the toggle.

Most of the time I have only a single class in a given class module, so what
I want is to collapse only the regions I have defined with #Region
statements. That is, I want an "Expand All Regions" and "Collapse All
Regions".

To illustrate, I want to be able to go, with a single key combination, from
this:

[Display State 1]

Public Class Foo
#Region " One "
...blah blah
#End Region

#Region " Two "
...blah blah
#End Region

#Region " Three "
...blah blah
#End Region
End Class

or this:

[Display State 2]

Public Class Foo
#Region " One "
...blah blah
#End Region

#Region " Two " ...

#Region " Three "
...blah blah
#End Region
End Class

to this:

[Display State 3]

Public Class Foo
#Region " One " ...
#Region " Two " ...
#Region " Three " ...
End Class

Maybe the real solution is to support outlining levels (as in Word). But I'd
settle for the above.

Greg Dunn
 
T

Tim Wilson

I don't think that there is a built in way to have that much control over
the outlining. But I'm sure that it is possible to create a macro that will
do this for you. This might not be worth the trouble depending on how
important it is in your situation. At this point I would say that the
automation model is the best bet to start with - there is an article at the
link below on this.
http://msdn.microsoft.com/library/d...html/vsoriAutomationExtensibilityOverview.asp

In addition, if you search around maybe someone has already done something
similar that you could apply to your own situation. I don't know of any
projects that exists that currently do this but there might be one floating
around GotDotNet samples and/or workspaces or in some other corner of the
Internet.

--
Tim Wilson
..Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
jsteele said:
Is this something similar to what you wanted:
<<

Similar, I suppose, but not *it*. Toggle All Outlining toggles between (a)
collapsing the entire class definition to a single entry, and (b) opening
the class definition back up, leaving individual regions collapsed or
expanded as they were before the toggle.

Most of the time I have only a single class in a given class module, so what
I want is to collapse only the regions I have defined with #Region
statements. That is, I want an "Expand All Regions" and "Collapse All
Regions".

To illustrate, I want to be able to go, with a single key combination, from
this:

[Display State 1]

Public Class Foo
#Region " One "
...blah blah
#End Region

#Region " Two "
...blah blah
#End Region

#Region " Three "
...blah blah
#End Region
End Class

or this:

[Display State 2]

Public Class Foo
#Region " One "
...blah blah
#End Region

#Region " Two " ...

#Region " Three "
...blah blah
#End Region
End Class

to this:

[Display State 3]

Public Class Foo
#Region " One " ...
#Region " Two " ...
#Region " Three " ...
End Class

Maybe the real solution is to support outlining levels (as in Word). But I'd
settle for the above.

Greg Dunn



Tim Wilson said:
Is this something similar to what you wanted:
"Toggle All Outlining" = Ctrl + M, Ctrl + L (hold down control then hit "m"
then hit "l")

--
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
missing
it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top