Creates a new element instance of a specified type.
Namespace: Microsoft.VisualStudio.Modeling
Assembly: Microsoft.VisualStudio.Modeling.Sdk (in Microsoft.VisualStudio.Modeling.Sdk.dll)
Syntax
'宣言
Public Function CreateElement ( _
domainClass As DomainClassInfo, _
ParamArray propertyAssignments As PropertyAssignment() _
) As ModelElement
'使用
Dim instance As ElementFactory
Dim domainClass As DomainClassInfo
Dim propertyAssignments As PropertyAssignment()
Dim returnValue As ModelElement
returnValue = instance.CreateElement(domainClass, _
propertyAssignments)
public ModelElement CreateElement(
DomainClassInfo domainClass,
params PropertyAssignment[] propertyAssignments
)
public:
ModelElement^ CreateElement(
DomainClassInfo^ domainClass,
... array<PropertyAssignment^>^ propertyAssignments
)
public function CreateElement(
domainClass : DomainClassInfo,
... propertyAssignments : PropertyAssignment[]
) : ModelElement
Parameters
domainClass
Type: Microsoft.VisualStudio.Modeling.DomainClassInfoThe domain class of the object to be created.
propertyAssignments
Type: []An array of property assignments to set immediately after element creation.
Return Value
Type: Microsoft.VisualStudio.Modeling.ModelElement
A new ModelElement object.
Permissions
- 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.