ElementFactory.CreateElement Method (Guid, [])

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 ( _
    domainClassId As Guid, _
    ParamArray propertyAssignments As PropertyAssignment() _
) As ModelElement
'使用
Dim instance As ElementFactory
Dim domainClassId As Guid
Dim propertyAssignments As PropertyAssignment()
Dim returnValue As ModelElement

returnValue = instance.CreateElement(domainClassId, _
    propertyAssignments)
public ModelElement CreateElement(
    Guid domainClassId,
    params PropertyAssignment[] propertyAssignments
)
public:
ModelElement^ CreateElement(
    Guid domainClassId, 
    ... array<PropertyAssignment^>^ propertyAssignments
)
public function CreateElement(
    domainClassId : Guid, 
    ... propertyAssignments : PropertyAssignment[]
) : ModelElement

Parameters

  • domainClassId
    Type: System.Guid

    The ID of the 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

See Also

Reference

ElementFactory Class

ElementFactory Members

CreateElement Overload

Microsoft.VisualStudio.Modeling Namespace