ShapeElement.CreateChildShape Method
Creates a shape and adds it as a child to this shape.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.dll)
Syntax
'Declaration
Protected Overridable Function CreateChildShape ( _
element As ModelElement _
) As ShapeElement
'Usage
Dim element As ModelElement
Dim returnValue As ShapeElement
returnValue = Me.CreateChildShape(element)
protected virtual ShapeElement CreateChildShape(
ModelElement element
)
protected:
virtual ShapeElement^ CreateChildShape(
ModelElement^ element
)
protected function CreateChildShape(
element : ModelElement
) : ShapeElement
Parameters
element
Type: Microsoft.VisualStudio.Modeling.ModelElementThe domain class instance which the shape is to represent.
Return Value
Type: Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement
The new child shape.
Remarks
You can override this method to create customized links and additional shapes.
For more information, see FixUpChildShapes(ModelElement).
Examples
protected override DslDiagrams::ShapeElement CreateChildShape(DslModeling::ModelElement element)
{
if(element is global::Fabrikam.DSL.TestValidation.ParentRelation)
{
return new global::Fabrikam.DSL.TestValidation.ParentConnector(this.Partition);
}
if(element is global::Fabrikam.DSL.TestValidation.Person)
{
return new global::Fabrikam.DSL.TestValidation.PersonShape(this.Partition);
}
return base.CreateChildShape(element);
}
.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.