Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Used to find an element in the target store or create it if it doesn't exist
Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.12.0.dll)
Syntax
'Declaration
Public Overridable Function FindOrCreateElement ( _
    sourceElementId As Guid, _
    domainClassId As Guid, _
    targetPartition As Partition, _
    elementGroup As ElementGroup _
) As ModelElement
public virtual ModelElement FindOrCreateElement(
    Guid sourceElementId,
    Guid domainClassId,
    Partition targetPartition,
    ElementGroup elementGroup
)
public:
virtual ModelElement^ FindOrCreateElement(
    Guid sourceElementId, 
    Guid domainClassId, 
    Partition^ targetPartition, 
    ElementGroup^ elementGroup
)
abstract FindOrCreateElement : 
        sourceElementId:Guid * 
        domainClassId:Guid * 
        targetPartition:Partition * 
        elementGroup:ElementGroup -> ModelElement  
override FindOrCreateElement : 
        sourceElementId:Guid * 
        domainClassId:Guid * 
        targetPartition:Partition * 
        elementGroup:ElementGroup -> ModelElement
public function FindOrCreateElement(
    sourceElementId : Guid, 
    domainClassId : Guid, 
    targetPartition : Partition, 
    elementGroup : ElementGroup
) : ModelElement
Parameters
- sourceElementId 
 Type: System.Guid- Id of the source element to find or create 
- domainClassId 
 Type: System.Guid- Id of the domain class for the element 
- targetPartition 
 Type: Microsoft.VisualStudio.Modeling.Partition- the parttion to search or create the new element 
- elementGroup 
 Type: Microsoft.VisualStudio.Modeling.ElementGroup- Element group 
Return Value
Type: Microsoft.VisualStudio.Modeling.ModelElement
the existing ModelElement or the newly created one if no existing match was found
Remarks
Used to find an element in the target store or create an element if it does not exist
.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.