ShapeElement.GetPotentialMouseAction 方法
取得在圖表中的特定點上執行的滑鼠按下事件的滑鼠動作。
命名空間: Microsoft.VisualStudio.Modeling.Diagrams
組件: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll 中)
語法
'宣告
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
)
參數
- mouseButtons
型別:System.Windows.Forms.MouseButtons
滑鼠按鈕,可能會造成滑鼠按下事件。
- point
型別:Microsoft.VisualStudio.Modeling.Diagrams.PointD
相對於圖表的左上角點在圖表上點。
- hitTestInfo
型別:Microsoft.VisualStudio.Modeling.Diagrams.DiagramHitTestInfo
點擊的測試的資訊。
傳回值
型別:Microsoft.VisualStudio.Modeling.Diagrams.MouseAction
在圖表中的特定點上執行的滑鼠按下事件滑鼠動作。
範例
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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。