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.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)
public: property bool ShouldTryParentShapeForMergeOnToolboxDoubleClick { virtual bool get(); }
Property Value
Type: System::BooleanA 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.
Warning |
|---|
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. |
