Share via


CompartmentShape.GetCompartmentDescriptions Method

Gets the descriptions for the compartment decorators.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Syntax

'Declaration
Public Overridable Function GetCompartmentDescriptions As CompartmentDescription()
public virtual CompartmentDescription[] GetCompartmentDescriptions()
public:
virtual array<CompartmentDescription^>^ GetCompartmentDescriptions()
abstract GetCompartmentDescriptions : unit -> CompartmentDescription[] 
override GetCompartmentDescriptions : unit -> CompartmentDescription[] 
public function GetCompartmentDescriptions() : CompartmentDescription[]

Return Value

Type: array<Microsoft.VisualStudio.Modeling.Diagrams.CompartmentDescription[]
The descriptions for the compartment decorators.

Examples

public override DslDiagrams::CompartmentDescription[] GetCompartmentDescriptions()
{
    if(compartmentDescriptions == null)
    {
        // Initialize the array of compartment descriptions if we haven't done so already. 
        // First we get any compartment descriptions in base shapes, and add on any compartments
        // that are defined on this shape. 
        DslDiagrams::CompartmentDescription[] baseCompartmentDescriptions = base.GetCompartmentDescriptions();
        
        int localCompartmentsOffset = 0;
        if(baseCompartmentDescriptions!=null)
        {
            localCompartmentsOffset = baseCompartmentDescriptions.Length;
        }
        compartmentDescriptions = new DslDiagrams::ElementListCompartmentDescription[1+localCompartmentsOffset];
        
        if(baseCompartmentDescriptions!=null)
        {
            baseCompartmentDescriptions.CopyTo(compartmentDescriptions, 0);
        }
        {
            string title = global::Microsoft.Example.ClassDiagrams.ClassDiagrams.SingletonResourceManager.GetString("InterfaceShapeOperationsCompartmentTitle");
            compartmentDescriptions[localCompartmentsOffset+0] = new DslDiagrams::ElementListCompartmentDescription("OperationsCompartment", title, 
                global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.LightGray), false, 
                global::System.Drawing.Color.FromKnownColor(global::System.Drawing.KnownColor.White), false,
                null, null,
                false);
        }
    }
    
    return InterfaceShape.compartmentDescriptions;
}

.NET Framework Security

See Also

Reference

CompartmentShape Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace