You can collapse just the compartments within a Compartment shape on its creation with the following code customization:
| |
namespace CompanyName.ProjectName.Language27.Designer { #region Using directives using System; using System.Collections.Generic; using Microsoft.VisualStudio.Modeling; using System.Diagnostics; using Microsoft.VisualStudio.Modeling.Utilities; using System.Drawing; using Microsoft.VisualStudio.Modeling.Diagrams; #endregion public partial class ClassShape { public override void EnsureCompartments() { base.EnsureCompartments(); foreach (Compartment comp in this.NestedChildShapes) { comp.IsExpanded = false; } } } }
|
Update: I've put this on my blog as an
entry, because other folks may find it useful. And, I explain it a little more too.