public WorksheetContextMenuManager
(
Microsoft.Office.Tools.Excel.WorkbookBase workbook,
Microsoft.Office.Tools.Excel.WorksheetBase edgeWorksheet,
Microsoft.Office.Tools.Excel.ListObject edgeTable,
Microsoft.Office.Tools.Excel.WorksheetBase vertexWorksheet,
Microsoft.Office.Tools.Excel.ListObject vertexTable,
Microsoft.Office.Tools.Excel.WorksheetBase groupWorksheet,
Microsoft.Office.Tools.Excel.ListObject groupTable
)
{
Debug.Assert(workbook != null);
Debug.Assert(edgeWorksheet != null);
Debug.Assert(edgeTable != null);
Debug.Assert(vertexWorksheet != null);
Debug.Assert(vertexTable != null);
Debug.Assert(groupWorksheet != null);
Debug.Assert(groupTable != null);
m_oWorkbook = workbook;
m_oEdgeTable = edgeTable;
m_oVertexTable = vertexTable;
m_oGroupTable = groupTable;
// Handle the events involved in adding, handling, and removing custom
// menu items.
workbook.Deactivate += new Microsoft.Office.Interop.
Excel.WorkbookEvents_DeactivateEventHandler(
this.Workbook_Deactivate);
edgeWorksheet.Deactivate += new Microsoft.Office.Interop.
Excel.DocEvents_DeactivateEventHandler(this.Worksheet_Deactivate);
vertexWorksheet.Deactivate += new Microsoft.Office.Interop.
Excel.DocEvents_DeactivateEventHandler(this.Worksheet_Deactivate);
groupWorksheet.Deactivate += new Microsoft.Office.Interop.
Excel.DocEvents_DeactivateEventHandler(this.Worksheet_Deactivate);
edgeTable.BeforeRightClick += new Microsoft.Office.Interop.Excel.
DocEvents_BeforeRightClickEventHandler(EdgeTable_BeforeRightClick);
vertexTable.BeforeRightClick += new Microsoft.Office.Interop.Excel.
DocEvents_BeforeRightClickEventHandler(
VertexTable_BeforeRightClick);
groupTable.BeforeRightClick += new Microsoft.Office.Interop.Excel.
DocEvents_BeforeRightClickEventHandler(
GroupTable_BeforeRightClick);
}