다음을 통해 공유


ShapeElement.GetPotentialMouseAction 메서드

다이어그램에 있는 특정 지점 위의 마우스 누름 이벤트에 대해 수행하는 마우스 동작을 가져옵니다.

네임스페이스:  Microsoft.VisualStudio.Modeling.Diagrams
어셈블리:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0(Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.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
)

매개 변수

반환 값

형식: 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 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

ShapeElement 클래스

Microsoft.VisualStudio.Modeling.Diagrams 네임스페이스