ShapeElement::OnOrphaned Method (SerializationResult^)

 

Called when a

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 OnOrphaned(
	SerializationResult^ serializationResult
)

Parameters

serializationResult
Type: Microsoft.VisualStudio.Modeling::SerializationResult^

The serialization warning or error to display if an orphan is found.

A shape is an orphan if it is not linked to a parent shape. The diagram is checked for orphans during deserialization. By default, orphans are removed from the diagram.

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: