ShapeElement.FixUpChildShapes Method
Creates or adjusts the child shapes that should be created when a model element is created or updated. Called by Diagram.FixUpDiagram().
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)
Syntax
'Declaration
Public Overridable Function FixUpChildShapes ( _
childElement As ModelElement _
) As ShapeElement
public virtual ShapeElement FixUpChildShapes(
ModelElement childElement
)
public:
virtual ShapeElement^ FixUpChildShapes(
ModelElement^ childElement
)
abstract FixUpChildShapes :
childElement:ModelElement -> ShapeElement
override FixUpChildShapes :
childElement:ModelElement -> ShapeElement
public function FixUpChildShapes(
childElement : ModelElement
) : ShapeElement
Parameters
childElement
Type: Microsoft.VisualStudio.Modeling.ModelElementThe new or re-parented model.
Return Value
Type: Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement
The new or updated child shape; otherwise, null, if no child shape was configured.
Remarks
An instance of a domain class in the model can be displayed by a shape on the diagram, according to the Diagram Element Maps specified in the DSL Definition. When a domain class instance is added to the model, this method is called to create the necessary shape or shapes. Less typically, this method is also called when the embedding relationship of an instance is changed: this can happen for example if the user cuts and pastes an element, or if an element is dragged from one container to another.
This method is called by FixUpDiagram to provide the opportunity to create and/or configure child shapes in response to addingthe specified element to the model or changing its parent.
You can override this method to modify the default behavior. You can alternatively override various methods that are called by FixupChildShapes(). Most of these methods are overridden in your shape class and are determined by its Diagram Element Map in the DSL Definition:
ShouldAddShapeForElement – to determine whether a child should be added for the new model element.
CreateChildShape – to construct a new shape for the domain class instance, if it does not already exist
ChooseParentShape – typically this shape
ChooseRelationship – to determine whether the child shape should be a in the Nested Child Shapes or Relative Child Shapes
OnChildConfiguring – called immediately after the shape becomes a child of this ShapeElement, but before its position has been set.
OnChildConfigured – called after the child shape’s position has been set
childShape.OnBoundsFixup() – called after the child’s position has been set to allow it to adjust its bounds
.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.