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
'Declaration
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
- serializationResult
Type: Microsoft.VisualStudio.Modeling.SerializationResult
The serialization warning or error to display if an orphan is found.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.