Compartilhar via


ShapeElement.OnOrphaned Method

Called when a

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

Syntax

'Declaração
Public Overridable Sub OnOrphaned ( _
    serializationResult As SerializationResult _
)
public virtual void OnOrphaned(
    SerializationResult serializationResult
)
public:
virtual void OnOrphaned(
    SerializationResult^ serializationResult
)
abstract OnOrphaned : 
        serializationResult:SerializationResult -> unit 
override OnOrphaned : 
        serializationResult:SerializationResult -> unit 
public function OnOrphaned(
    serializationResult : SerializationResult
)

Parameters

Remarks

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.

Examples

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);
}
}

.NET Framework Security

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace