ShapeElement.CreateChildShape 方法

创建形状并将它作为子添加到此形状。

命名空间:  Microsoft.VisualStudio.Modeling.Diagrams
程序集:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll 中)

语法

声明
Protected Overridable Function CreateChildShape ( _
    element As ModelElement _
) As ShapeElement
protected virtual ShapeElement CreateChildShape(
    ModelElement element
)

参数

返回值

类型:Microsoft.VisualStudio.Modeling.Diagrams.ShapeElement
新子形状。

备注

可以重写此方法创建自定义的链接和其他形状。

有关详细信息,请参阅 FixUpChildShapes

示例

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 安全性

请参阅

参考

ShapeElement 类

Microsoft.VisualStudio.Modeling.Diagrams 命名空间