private void ProcessButton_Click(object sender, RibbonControlEventArgs e) { switch (e.Control.Id) { case "ProcessSingleButton": Worksheet sheet = ThisAddIn.app.ActiveWorkbook.ActiveSheet; ILogProcessor processor = Util.GetCorrectProcessorForImportedSheet(sheet); if (processor != null) { Dispatch.ProcessSheetWithProcessor(sheet, processor); } else { Util.MessageBox("Active worksheet not recognized as a valid log."); } break; case "ProcessAllButton": List <string> sheetNames = new List <string>(); int processed = 0; foreach (Worksheet sh in ThisAddIn.app.ActiveWorkbook.Sheets) { sheetNames.Add(sh.Name); } foreach (string sheetname in sheetNames) { Worksheet sheet_ = ThisAddIn.app.ActiveWorkbook.Sheets[sheetname]; ILogProcessor processor_ = Util.GetCorrectProcessorForImportedSheet(sheet_); if (processor_ != null) { Dispatch.ProcessSheetWithProcessor(sheet_, processor_); processed++; } } Util.MessageBox(processed + " sheet(s) processed."); break; } }
private void ProcessFolderMenuButton_Click(object sender, RibbonControlEventArgs e) { switch (e.Control.Id) { case "ProcessDS200Button": Dispatch.ProcessEntireDirectory(LogType.DS200); break; case "ProcessVSAPBMDButton": Dispatch.ProcessEntireDirectory(LogType.VSAP_BMD); break; case "ProcessDICEButton": Dispatch.ProcessEntireDirectory(LogType.DICE); break; case "ProcessDICXButton": Dispatch.ProcessEntireDirectory(LogType.DICX); break; default: break; } }