private void AddJaJp(XlsxReader xlsx, IProgress <string> progress) { const string jaJpName = "text/im2nx_text.ja_jp"; if (!HasFile(jaJpName) && xlsx.Sheets.Descendants <Sheet>().Any(sheet => sheet.Name == "jaJp") && xlsx.Sheets.Descendants <Sheet>().Any(sheet => sheet.Name == "jaJpStrings")) { progress?.Report(string.Format("Adding {0}", jaJpName)); ZipArchiveEntry entry = zipArchive.CreateEntry(jaJpName); using Stream entryStream = entry.Open(); JaJpText.WriteFile(entryStream, xlsx); _entries.Add(new PatchZipEntry(entry)); } }
public void JaJpWriteTest(string xlsxName, string binName) { using FileStream stream = new FileStream(binName, FileMode.Create, FileAccess.Write); using XlsxReader xlsxReader = new XlsxReader(xlsxName); JaJpText.WriteFile(stream, xlsxReader); }
//[DataRow("new.ja_jp", "text_ja_jp_reread.xlsx")] public void JaJpReadTest(string binName, string xlsxName) { using FileStream stream = new FileStream(binName, FileMode.Open, FileAccess.Read); using XlsxWriter xlsxWriter = new XlsxWriter(xlsxName, true); JaJpText.ReadFile(stream, xlsxWriter); }