Share via


ModelElement.ChooseMergeTarget Method (ElementGroupPrototype)

Selects a target element to accept as its child an element that the user wants to copy, drag, or create.

Namespace:  Microsoft.VisualStudio.Modeling
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.11.0.dll)

Syntax

'Declaration
Protected Overridable Function ChooseMergeTarget ( _
    elementGroupPrototype As ElementGroupPrototype _
) As ModelElement
protected virtual ModelElement ChooseMergeTarget(
    ElementGroupPrototype elementGroupPrototype
)
protected:
virtual ModelElement^ ChooseMergeTarget(
    ElementGroupPrototype^ elementGroupPrototype
)
abstract ChooseMergeTarget : 
        elementGroupPrototype:ElementGroupPrototype -> ModelElement  
override ChooseMergeTarget : 
        elementGroupPrototype:ElementGroupPrototype -> ModelElement
protected function ChooseMergeTarget(
    elementGroupPrototype : ElementGroupPrototype
) : ModelElement

Parameters

Return Value

Type: Microsoft.VisualStudio.Modeling.ModelElement
The ModelElement to use as the target for the merge process.

Remarks

A merge operation is what happens when the user uses a tool to create a model element, or performs the paste command, or drags an element onto another. Merge combines the new or copied elements into the existing model.

This method is called when a merge is about to happen. It allows the target element to redirect the merge operation so that another element is the target. For example, a part of a larger object could redirect the merge operation to its parent. This is a benefit for the user, who does not have to distinguish between the part and its parent when dragging a tool or object.

The default method returns this element as the target.

.NET Framework Security

See Also

Reference

ModelElement Class

ChooseMergeTarget Overload

Microsoft.VisualStudio.Modeling Namespace