다음을 통해 공유


ShapeElement.NestedChildShapes Property

The list of shapes that are part of this shape, and are constrained to appear within the boundaries of this shape or diagram.

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

Syntax

‘선언
Public ReadOnly Property NestedChildShapes As LinkedElementCollection(Of ShapeElement)
    Get
public LinkedElementCollection<ShapeElement> NestedChildShapes { get; }
public:
property LinkedElementCollection<ShapeElement^>^ NestedChildShapes {
    LinkedElementCollection<ShapeElement^>^ get ();
}
member NestedChildShapes : LinkedElementCollection<ShapeElement>
function get NestedChildShapes () : LinkedElementCollection<ShapeElement>

Property Value

Type: Microsoft.VisualStudio.Modeling.LinkedElementCollection<ShapeElement>

Remarks

Nested child shapes and connectors are restricted within the bounds of their ParentShape. The user cannot drag a shape outside its parent’s boundary, and the routing of connectors keeps them within the bounds.

The ParentShapeof every child shape is this ShapeElement.

Child shapes are usually painted in the order of the list, so that the first item is at the back. If you change the order of the list, call:

shape.Diagram.NeedsRenumber = true; shape.Invalidate();

Examples

To see the list of shapes and connectors on a diagram, use the following code. Each shape and connector might have its own child shapes:

foreach (ShapeElement element in diagram.NestedChildShapes 
{
  if (element is NodeShape)  { /* icon or geometric shape */  }
  else if (element is BinaryLinkShape) { /* connector */ }
}

.NET Framework Security

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace

RelativeChildShape()

ParentShape

BoundingBox

IsNestedChild