다음을 통해 공유


ShapeElement.ShouldTryParentShapeForMergeOnToolboxDoubleClick Property

If true, when the user double-clicks a toolbox item with this shape selected, if the tool cannot be merged with this shape, then a merge with the parent shape will be attempted. Defaults to true.

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

Syntax

‘선언
Public Overridable ReadOnly Property ShouldTryParentShapeForMergeOnToolboxDoubleClick As Boolean
    Get
public virtual bool ShouldTryParentShapeForMergeOnToolboxDoubleClick { get; }
public:
virtual property bool ShouldTryParentShapeForMergeOnToolboxDoubleClick {
    bool get ();
}
abstract ShouldTryParentShapeForMergeOnToolboxDoubleClick : bool
override ShouldTryParentShapeForMergeOnToolboxDoubleClick : bool
function get ShouldTryParentShapeForMergeOnToolboxDoubleClick () : boolean

Property Value

Type: System.Boolean

Remarks

A quick way for a user of your DSL to create several elements is to repeatedly double-click a toolbox item. For example, in a DSL created using the Components solution template, you can place several components on the diagram by repeatedly double-clicking the Component tool. In the same way, you can quickly create several ports on a component by selecting the component and then repeatedly double-clicking the Input Port or Output Port tool.

Normally, double-clicking a tool creates a new item as a child of the selected element. For example, if you select a component and double-click the Input Port tool, a new port is created on the selected component. When the operation ends, the new item is selected. This presents a difficulty: if the user now double-clicks the Output Port tool, nothing should happen, because an Output Port cannot have an Input Port as its parent. However, if ShouldTryParentShapeForMergeOnToolboxDoubleClick returns true, a new port will be added to the parent component instead.

This property defaults to true, but you can override its definition in your shape class.

경고

If you set Uses Sticky Tools in the Editor property in DSL Explorer, then this property is never called. Double-clicking the toolbox lets the user click repeatedly on the diagram to create new items.

.NET Framework Security

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace