C# Class Smrf.NodeXL.ExcelTemplate.WorksheetContextMenuManager

Adds custom menu items to the Excel context menus that appear when one of several tables is clicked in the workbook.
This class takes care of all of the details involved in adding custom NodeXL menu items to the Excel context menus, including handling and forwarding the events that are fired when the custom menu items are clicked.

A RequestEdgeCommandEnable or event is fired before an edge or vertex table context menu is displayed and this class needs to know which menu items to enable. A RunNoParamCommandEventArgs command is sent via the CommandDispatcher class when the user clicks one of the custom menu items.

Inheritance: Object
Afficher le fichier Open project: 2014-sed-team3/term-project Class Usage Examples

Méthodes publiques

Свойство Type Description
NoRowID System.Int32

Protected Properties

Свойство Type Description
m_oEdgeTable Microsoft.Office.Tools.Excel.ListObject
m_oGroupTable Microsoft.Office.Tools.Excel.ListObject
m_oVertexTable Microsoft.Office.Tools.Excel.ListObject
m_oWorkbook Microsoft.Office.Tools.Excel.WorkbookBase

Méthodes publiques

Méthode Description
WorksheetContextMenuManager ( Microsoft workbook, Microsoft edgeWorksheet, Microsoft edgeTable, Microsoft vertexWorksheet, Microsoft vertexTable, Microsoft groupWorksheet, Microsoft groupTable ) : System

Initializes a new instance of the class.

Méthodes protégées

Méthode Description
AddContextMenuItem ( CommandBarPopup oCommandBarPopup, String sText, Int32 iClickedID, _CommandBarButtonEvents_ClickEventHandler oEventHandler ) : System.Windows.Forms.CommandBarButton
AddContextMenuSeparator ( CommandBar oTableContextCommandBar, System.Boolean bAdd ) : void
AddEdgeContextMenuItems ( Microsoft oClickedRange ) : void
AddGroupContextMenuItems ( Microsoft oClickedRange ) : void
AddSetColorContextMenuItem ( Microsoft oTable, Microsoft oClickedRange ) : void
AddTopLevelPopup ( CommandBar oTableContextCommandBar ) : CommandBarPopup
AddVertexContextMenuItems ( Microsoft oClickedRange ) : void
CommandBarButtonToClickedID ( System.Windows.Forms.CommandBarButton oCommandBarButton ) : Int32
EdgeTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
GroupTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
PrepareToAddChildMenuItems ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID, CommandBarPopup &oTopLevelPopup ) : void
RemoveContextMenuItems ( ) : void
RunAVertexCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, VertexCommand eVertexCommand ) : void
RunAnEdgeCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, EdgeCommand eEdgeCommand ) : void
TryGetClickedID ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID ) : System.Boolean
VertexTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Workbook_Deactivate ( ) : void
Worksheet_Deactivate ( ) : void
oDeselectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oDeselectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oDeselectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oDeselectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oDeselectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oEditVertexAttributesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSelectSubgraphsButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
oSetColorButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void

Private Methods

Méthode Description
AssertValid ( ) : void

Method Details

AddContextMenuItem() protected méthode

protected AddContextMenuItem ( CommandBarPopup oCommandBarPopup, String sText, Int32 iClickedID, _CommandBarButtonEvents_ClickEventHandler oEventHandler ) : System.Windows.Forms.CommandBarButton
oCommandBarPopup CommandBarPopup
sText String
iClickedID System.Int32
oEventHandler _CommandBarButtonEvents_ClickEventHandler
Résultat System.Windows.Forms.CommandBarButton

AddContextMenuSeparator() protected méthode

protected AddContextMenuSeparator ( CommandBar oTableContextCommandBar, System.Boolean bAdd ) : void
oTableContextCommandBar System.Windows.Forms.CommandBar
bAdd System.Boolean
Résultat void

AddEdgeContextMenuItems() protected méthode

protected AddEdgeContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Résultat void

AddGroupContextMenuItems() protected méthode

protected AddGroupContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Résultat void

AddSetColorContextMenuItem() protected méthode

protected AddSetColorContextMenuItem ( Microsoft oTable, Microsoft oClickedRange ) : void
oTable Microsoft
oClickedRange Microsoft
Résultat void

AddTopLevelPopup() protected méthode

protected AddTopLevelPopup ( CommandBar oTableContextCommandBar ) : CommandBarPopup
oTableContextCommandBar System.Windows.Forms.CommandBar
Résultat CommandBarPopup

AddVertexContextMenuItems() protected méthode

protected AddVertexContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Résultat void

CommandBarButtonToClickedID() protected méthode

protected CommandBarButtonToClickedID ( System.Windows.Forms.CommandBarButton oCommandBarButton ) : Int32
oCommandBarButton System.Windows.Forms.CommandBarButton
Résultat System.Int32

EdgeTable_BeforeRightClick() protected méthode

protected EdgeTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Résultat void

GroupTable_BeforeRightClick() protected méthode

protected GroupTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Résultat void

PrepareToAddChildMenuItems() protected méthode

protected PrepareToAddChildMenuItems ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID, CommandBarPopup &oTopLevelPopup ) : void
oClickedRange Microsoft
oTable Microsoft
sIDColumnName String
iClickedID System.Int32
oTopLevelPopup CommandBarPopup
Résultat void

RemoveContextMenuItems() protected méthode

protected RemoveContextMenuItems ( ) : void
Résultat void

RunAVertexCommand() protected méthode

protected RunAVertexCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, VertexCommand eVertexCommand ) : void
oCommandBarButton System.Windows.Forms.CommandBarButton
eVertexCommand VertexCommand
Résultat void

RunAnEdgeCommand() protected méthode

protected RunAnEdgeCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, EdgeCommand eEdgeCommand ) : void
oCommandBarButton System.Windows.Forms.CommandBarButton
eEdgeCommand EdgeCommand
Résultat void

TryGetClickedID() protected méthode

protected TryGetClickedID ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID ) : System.Boolean
oClickedRange Microsoft
oTable Microsoft
sIDColumnName String
iClickedID System.Int32
Résultat System.Boolean

VertexTable_BeforeRightClick() protected méthode

protected VertexTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Résultat void

Workbook_Deactivate() protected méthode

protected Workbook_Deactivate ( ) : void
Résultat void

WorksheetContextMenuManager() public méthode

Initializes a new instance of the class.
public WorksheetContextMenuManager ( Microsoft workbook, Microsoft edgeWorksheet, Microsoft edgeTable, Microsoft vertexWorksheet, Microsoft vertexTable, Microsoft groupWorksheet, Microsoft groupTable ) : System
workbook Microsoft /// Excel workbook. ///
edgeWorksheet Microsoft /// The edge worksheet in the Excel workbook. ///
edgeTable Microsoft /// The edge table on the edge worksheet. ///
vertexWorksheet Microsoft /// The vertex worksheet in the Excel workbook. ///
vertexTable Microsoft /// The vertex table on the vertex worksheet. ///
groupWorksheet Microsoft /// The group worksheet in the Excel workbook. ///
groupTable Microsoft /// The group table on the group worksheet. ///
Résultat System

Worksheet_Deactivate() protected méthode

protected Worksheet_Deactivate ( ) : void
Résultat void

oDeselectAdjacentVerticesOfEdgeButton_Click() protected méthode

protected oDeselectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oDeselectAdjacentVerticesOfVertexButton_Click() protected méthode

protected oDeselectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oDeselectAllEdgesButton_Click() protected méthode

protected oDeselectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oDeselectAllVerticesButton_Click() protected méthode

protected oDeselectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oDeselectIncidentEdgesButton_Click() protected méthode

protected oDeselectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oEditVertexAttributesButton_Click() protected méthode

protected oEditVertexAttributesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectAdjacentVerticesOfEdgeButton_Click() protected méthode

protected oSelectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectAdjacentVerticesOfVertexButton_Click() protected méthode

protected oSelectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectAllEdgesButton_Click() protected méthode

protected oSelectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectAllVerticesButton_Click() protected méthode

protected oSelectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectIncidentEdgesButton_Click() protected méthode

protected oSelectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSelectSubgraphsButton_Click() protected méthode

protected oSelectSubgraphsButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

oSetColorButton_Click() protected méthode

protected oSetColorButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Résultat void

Property Details

NoRowID public_oe static_oe property

Indicates that an edge or vertex row ID isn't available.
public static Int32,System NoRowID
Résultat System.Int32

m_oEdgeTable protected_oe property

protected Microsoft.Office.Tools.Excel.ListObject m_oEdgeTable
Résultat Microsoft.Office.Tools.Excel.ListObject

m_oGroupTable protected_oe property

protected Microsoft.Office.Tools.Excel.ListObject m_oGroupTable
Résultat Microsoft.Office.Tools.Excel.ListObject

m_oVertexTable protected_oe property

protected Microsoft.Office.Tools.Excel.ListObject m_oVertexTable
Résultat Microsoft.Office.Tools.Excel.ListObject

m_oWorkbook protected_oe property

protected Microsoft.Office.Tools.Excel.WorkbookBase m_oWorkbook
Résultat Microsoft.Office.Tools.Excel.WorkbookBase