コード例 #1
0
        ITabularBook OpenWorkbook(Stream stream, string filename, ITabularLibrary excel)
        {
            var workbook = excel.OpenBook(stream);

            workbook.Filename = filename;
            return(workbook);
        }
コード例 #2
0
 private static void OutputWorkbook(
     string specificationFolder,
     string projectRootNamespace,
     IEnumerable <string> usings,
     string assertionClassPrefix,
     ITabularLibrary excel,
     XElement compileItemGroupNode,
     string excelFileName)
 {
     using (var workbookFile = GetExcelFileStream(excelFileName))
     {
         using (var workbook = excel.OpenBook(workbookFile))
         {
             var workBookName = Path.GetFileNameWithoutExtension(excelFileName);
             for (int i = 0; i < workbook.NumberOfPages; i++)
             {
                 if (IsTestSheet(workbook.GetPage(i)))
                 {
                     compileItemGroupNode.Add(MakeFileElement(compileItemGroupNode.Name.Namespace.NamespaceName, "Compile", OutputWorkSheet(specificationFolder, usings, assertionClassPrefix, workBookName, workbook.GetPage(i), projectRootNamespace)));
                 }
             }
         }
     }
 }