ShapeElement::IterateShapes Method (IShapeIterator^)

 

Iterates through a shape and its child shapes.

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

public:
virtual void IterateShapes(
	IShapeIterator^ iterator
)

Parameters

iterator
Type: Microsoft.VisualStudio.Modeling.Diagrams::IShapeIterator^

The iterator to use with the shape.

This method recursively goes through all child shapes that are assigned to the shape and calls the iterator when each child shape is encountered. By default, the traversal is depth first, and nested child shapes are iterated before relative child shapes.

protected virtual void CheckForOrphanedShapes(DslDiagrams::Diagram diagram, DslModeling::SerializationResult serializationResult)
{
global::System.Collections.Generic.List<DslDiagrams::ShapeElement> orphanedShapes = new global::System.Collections.Generic.List<DslDiagrams::ShapeElement>();
diagram.IterateShapes(new OrphanedShapeIterator(orphanedShapes, diagram));
foreach (DslDiagrams::ShapeElement orphanedShape in orphanedShapes)
{
if (serializationResult.Failed)
break;

orphanedShape.OnOrphaned(serializationResult);
}
}
Return to top
Show: