OnMouseDownRight
(
Point oMouseLocation,
IVertex oClickedVertex
)
{
AssertValid();
if (oClickedVertex == null)
{
// Right-clicking a part of the graph not covered by a vertex
// should do nothing.
return;
}
switch (m_eMouseMode)
{
case MouseMode.Select:
case MouseMode.AddToSelection:
break;
default:
return;
}
// In Select mode, right-clicking an unselected vertex should clear the
// selection and then select the vertex.
//
// In AddToSelection mode, right-clicking an unselected vertex should
// select the vertex.
if (
m_eMouseMode == MouseMode.Select &&
!VertexOrEdgeIsSelected(oClickedVertex)
)
{
SetAllVerticesSelected(false);
SetAllEdgesSelected(false);
}
SetVertexSelected(oClickedVertex, true,
m_bMouseAlsoSelectsIncidentEdges);
}