ShapeElement.GetPotentialMouseAction Method
Gets the mouse action to perform for a mouse down event over a specific point in the diagram.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
Syntax
'Declaración
Public Overridable Function GetPotentialMouseAction ( _
mouseButtons As MouseButtons, _
point As PointD, _
hitTestInfo As DiagramHitTestInfo _
) As MouseAction
public virtual MouseAction GetPotentialMouseAction(
MouseButtons mouseButtons,
PointD point,
DiagramHitTestInfo hitTestInfo
)
public:
virtual MouseAction^ GetPotentialMouseAction(
MouseButtons mouseButtons,
PointD point,
DiagramHitTestInfo^ hitTestInfo
)
abstract GetPotentialMouseAction :
mouseButtons:MouseButtons *
point:PointD *
hitTestInfo:DiagramHitTestInfo -> MouseAction
override GetPotentialMouseAction :
mouseButtons:MouseButtons *
point:PointD *
hitTestInfo:DiagramHitTestInfo -> MouseAction
public function GetPotentialMouseAction(
mouseButtons : MouseButtons,
point : PointD,
hitTestInfo : DiagramHitTestInfo
) : MouseAction
Parameters
- mouseButtons
Type: System.Windows.Forms.MouseButtons
The mouse buttons that can cause the mouse down event.
- point
Type: Microsoft.VisualStudio.Modeling.Diagrams.PointD
The point on the diagram, relative to the top-left point of the diagram.
- hitTestInfo
Type: Microsoft.VisualStudio.Modeling.Diagrams.DiagramHitTestInfo
The hit test information.
Return Value
Type: Microsoft.VisualStudio.Modeling.Diagrams.MouseAction
The mouse action to perform for a mouse down event over a specific point in the diagram.
Examples
public override DslDiagrams::MouseAction GetPotentialMouseAction(System.Windows.Forms.MouseButtons mouseButtons, DslDiagrams.PointD point, DslDiagrams::DiagramHitTestInfo hitTestInfo)
{
DslDiagrams::LinkShape linkShape = hitTestInfo.HitDiagramItem.Shape as DslDiagrams::LinkShape;
DslDiagrams::AnchorPoint anchorPoint = hitTestInfo.HitDiagramItem.AnchorPoint;
DslDiagrams::MouseAction action = null;
if ((linkShape != null) && (hitTestInfo.DiagramClientView.Selection.Count == 1) &&
(anchorPoint != null))
{
action = this.SequenceDiagram.AnchorKeyPointAction;
}
else if ((mouseButtons == MouseButtons.Left || mouseButtons == MouseButtons.None) &&
(linkShape != null) && (hitTestInfo.DiagramClientView.Selection.Count == 1) &&
(hitTestInfo.DiagramClientView.Selection.PrimaryItem.Shape is LinkShape) &&
(hitTestInfo.DiagramClientView.Selection.PrimaryItem.Shape == linkShape) &&
(hitTestInfo.DiagramClientView.Selection.FocusedItem != null) &&
(hitTestInfo.DiagramClientView.Selection.FocusedItem.Shape == linkShape))
{
action = this.SequenceDiagram.AnchorKeyPointAction;
}
else
{
action = base.GetPotentialMouseAction(mouseButtons, point, hitTestInfo);
}
return action;
}
return action;
}
.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.