RunVertexCommand
(
RunVertexCommandEventArgs e
)
{
AssertValid();
// Ge the vertex corresponding to the row the user right-clicked in the
// vertex worksheet. This can be null.
IVertex oClickedVertex =
WorksheetContextMenuManagerRowIDToVertex(e.VertexRowID);
WorksheetContextMenuManager.VertexCommand eVertexCommand =
e.VertexCommand;
switch (eVertexCommand)
{
case WorksheetContextMenuManager.VertexCommand.SelectAllVertices:
case WorksheetContextMenuManager.VertexCommand.DeselectAllVertices:
SelectAllVertices(eVertexCommand ==
WorksheetContextMenuManager.VertexCommand.
SelectAllVertices);
break;
case WorksheetContextMenuManager.VertexCommand.
SelectAdjacentVertices:
case WorksheetContextMenuManager.VertexCommand.
DeselectAdjacentVertices:
if (oClickedVertex != null)
{
SelectAdjacentVertices(oClickedVertex,
eVertexCommand == WorksheetContextMenuManager.
VertexCommand.SelectAdjacentVertices);
}
break;
case WorksheetContextMenuManager.VertexCommand.SelectIncidentEdges:
case WorksheetContextMenuManager.VertexCommand.
DeselectIncidentEdges:
if (oClickedVertex != null)
{
SelectIncidentEdges(oClickedVertex,
eVertexCommand == WorksheetContextMenuManager.
VertexCommand.SelectIncidentEdges);
}
break;
case WorksheetContextMenuManager.VertexCommand.
EditVertexAttributes:
EditVertexAttributes();
break;
case WorksheetContextMenuManager.VertexCommand.SelectSubgraphs:
SelectSubgraphs(oClickedVertex);
break;
default:
Debug.Assert(false);
break;
}
}