다음을 통해 공유


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.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)

Syntax

‘선언
Protected Overridable Function CreateChildShape ( _
    element As ModelElement _
) As ShapeElement
protected virtual ShapeElement CreateChildShape(
    ModelElement element
)
protected:
virtual ShapeElement^ CreateChildShape(
    ModelElement^ element
)
abstract CreateChildShape : 
        element:ModelElement -> ShapeElement 
override CreateChildShape : 
        element:ModelElement -> ShapeElement 
protected function CreateChildShape(
    element : ModelElement
) : ShapeElement

Parameters

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

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace