C# Класс 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.

Наследование: Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
NoRowID System.Int32

Защищенные свойства (Protected)

Свойство Тип Описание
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

Открытые методы

Метод Описание
WorksheetContextMenuManager ( Microsoft workbook, Microsoft edgeWorksheet, Microsoft edgeTable, Microsoft vertexWorksheet, Microsoft vertexTable, Microsoft groupWorksheet, Microsoft groupTable ) : System

Initializes a new instance of the class.

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
AssertValid ( ) : void

Описание методов

AddContextMenuItem() защищенный Метод

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
Результат System.Windows.Forms.CommandBarButton

AddContextMenuSeparator() защищенный Метод

protected AddContextMenuSeparator ( CommandBar oTableContextCommandBar, System.Boolean bAdd ) : void
oTableContextCommandBar System.Windows.Forms.CommandBar
bAdd System.Boolean
Результат void

AddEdgeContextMenuItems() защищенный Метод

protected AddEdgeContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Результат void

AddGroupContextMenuItems() защищенный Метод

protected AddGroupContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Результат void

AddSetColorContextMenuItem() защищенный Метод

protected AddSetColorContextMenuItem ( Microsoft oTable, Microsoft oClickedRange ) : void
oTable Microsoft
oClickedRange Microsoft
Результат void

AddTopLevelPopup() защищенный Метод

protected AddTopLevelPopup ( CommandBar oTableContextCommandBar ) : CommandBarPopup
oTableContextCommandBar System.Windows.Forms.CommandBar
Результат CommandBarPopup

AddVertexContextMenuItems() защищенный Метод

protected AddVertexContextMenuItems ( Microsoft oClickedRange ) : void
oClickedRange Microsoft
Результат void

CommandBarButtonToClickedID() защищенный Метод

protected CommandBarButtonToClickedID ( System.Windows.Forms.CommandBarButton oCommandBarButton ) : Int32
oCommandBarButton System.Windows.Forms.CommandBarButton
Результат System.Int32

EdgeTable_BeforeRightClick() защищенный Метод

protected EdgeTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Результат void

GroupTable_BeforeRightClick() защищенный Метод

protected GroupTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Результат void

PrepareToAddChildMenuItems() защищенный Метод

protected PrepareToAddChildMenuItems ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID, CommandBarPopup &oTopLevelPopup ) : void
oClickedRange Microsoft
oTable Microsoft
sIDColumnName String
iClickedID System.Int32
oTopLevelPopup CommandBarPopup
Результат void

RemoveContextMenuItems() защищенный Метод

protected RemoveContextMenuItems ( ) : void
Результат void

RunAVertexCommand() защищенный Метод

protected RunAVertexCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, VertexCommand eVertexCommand ) : void
oCommandBarButton System.Windows.Forms.CommandBarButton
eVertexCommand VertexCommand
Результат void

RunAnEdgeCommand() защищенный Метод

protected RunAnEdgeCommand ( System.Windows.Forms.CommandBarButton oCommandBarButton, EdgeCommand eEdgeCommand ) : void
oCommandBarButton System.Windows.Forms.CommandBarButton
eEdgeCommand EdgeCommand
Результат void

TryGetClickedID() защищенный Метод

protected TryGetClickedID ( Microsoft oClickedRange, Microsoft oTable, String sIDColumnName, Int32 &iClickedID ) : System.Boolean
oClickedRange Microsoft
oTable Microsoft
sIDColumnName String
iClickedID System.Int32
Результат System.Boolean

VertexTable_BeforeRightClick() защищенный Метод

protected VertexTable_BeforeRightClick ( Microsoft Target, bool &Cancel ) : void
Target Microsoft
Cancel bool
Результат void

Workbook_Deactivate() защищенный Метод

protected Workbook_Deactivate ( ) : void
Результат void

WorksheetContextMenuManager() публичный Метод

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. ///
Результат System

Worksheet_Deactivate() защищенный Метод

protected Worksheet_Deactivate ( ) : void
Результат void

oDeselectAdjacentVerticesOfEdgeButton_Click() защищенный Метод

protected oDeselectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oDeselectAdjacentVerticesOfVertexButton_Click() защищенный Метод

protected oDeselectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oDeselectAllEdgesButton_Click() защищенный Метод

protected oDeselectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oDeselectAllVerticesButton_Click() защищенный Метод

protected oDeselectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oDeselectIncidentEdgesButton_Click() защищенный Метод

protected oDeselectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oEditVertexAttributesButton_Click() защищенный Метод

protected oEditVertexAttributesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectAdjacentVerticesOfEdgeButton_Click() защищенный Метод

protected oSelectAdjacentVerticesOfEdgeButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectAdjacentVerticesOfVertexButton_Click() защищенный Метод

protected oSelectAdjacentVerticesOfVertexButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectAllEdgesButton_Click() защищенный Метод

protected oSelectAllEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectAllVerticesButton_Click() защищенный Метод

protected oSelectAllVerticesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectIncidentEdgesButton_Click() защищенный Метод

protected oSelectIncidentEdgesButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSelectSubgraphsButton_Click() защищенный Метод

protected oSelectSubgraphsButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

oSetColorButton_Click() защищенный Метод

protected oSetColorButton_Click ( System.Windows.Forms.CommandBarButton Ctrl, bool &CancelDefault ) : void
Ctrl System.Windows.Forms.CommandBarButton
CancelDefault bool
Результат void

Описание свойств

NoRowID публичное статическое свойство

Indicates that an edge or vertex row ID isn't available.
public static Int32,System NoRowID
Результат System.Int32

m_oEdgeTable защищенное свойство

protected Microsoft.Office.Tools.Excel.ListObject m_oEdgeTable
Результат Microsoft.Office.Tools.Excel.ListObject

m_oGroupTable защищенное свойство

protected Microsoft.Office.Tools.Excel.ListObject m_oGroupTable
Результат Microsoft.Office.Tools.Excel.ListObject

m_oVertexTable защищенное свойство

protected Microsoft.Office.Tools.Excel.ListObject m_oVertexTable
Результат Microsoft.Office.Tools.Excel.ListObject

m_oWorkbook защищенное свойство

protected Microsoft.Office.Tools.Excel.WorkbookBase m_oWorkbook
Результат Microsoft.Office.Tools.Excel.WorkbookBase