Пример #1
0
        public void コンストラクタにnullが指定されると何も読み込まない()
        {
            // setup
            XlsxSharedStrings strings = new XlsxSharedStrings(null);

            // expect
            Assert.AreEqual(0, strings.Count);
        }
Пример #2
0
 private void ReadWorkbookInformation()
 {
     try
     {
         this.zipFile = ZipFile.Read(fileName);
         using (Stream stream = GetInputStream("xl/workbook.xml")) { workbook = new XlsxWorkbook(stream); }
         using (Stream stream = GetInputStream("xl/styles.xml")) { styles = new XlsxStyles(stream); }
         using (Stream stream = GetInputStream("xl/sharedStrings.xml")) { sharedStrings = new XlsxSharedStrings(stream); }
     }
     finally
     {
         Close();
     }
 }
Пример #3
0
        public void コンストラクタは指定されたstreamから共有文字列を読み込む()
        {
            // setup
            using (FileStream stream = new FileStream(GetSharedStringsPath(), FileMode.Open, FileAccess.Read))
            {
                XlsxSharedStrings strings = new XlsxSharedStrings(stream);

                // expect
                Assert.AreEqual(6, strings.Count);
                Assert.AreEqual("aiueo", strings[0]);
                Assert.AreEqual("A1: aiueo", strings[1]);
                Assert.AreEqual("B1: あいうえお", strings[2]);
                Assert.AreEqual("A2: kakiku", strings[3]);
                Assert.AreEqual("B2: かきく", strings[4]);
                Assert.AreEqual("B3:今日は", strings[5]);
            }
        }
Пример #4
0
 /// <summary>
 /// <see cref="XlsxWorksheetHandler"/> を作成する。
 /// </summary>
 /// <param name="styles">書式情報</param>
 /// <param name="sharedStrings">共有文字列情報</param>
 /// <param name="xlsxCellParser">セル処理</param>
 public XlsxWorksheetHandler(XlsxStyles styles, XlsxSharedStrings sharedStrings, XlsxCellParser xlsxCellParser)
 {
     this.styles = styles;
     this.sharedStrings = sharedStrings;
     this.cellParser = xlsxCellParser;
 }
Пример #5
0
 private void ReadWorkbookInformation()
 {
     try
     {
         this.zipFile = ZipFile.Read(fileName);
         using (Stream stream = GetInputStream("xl/workbook.xml")) { workbook = new XlsxWorkbook(stream); }
         using (Stream stream = GetInputStream("xl/styles.xml")) { styles = new XlsxStyles(stream); }
         using (Stream stream = GetInputStream("xl/sharedStrings.xml")) { sharedStrings = new XlsxSharedStrings(stream); }
     }
     finally
     {
         Close();
     }
 }
Пример #6
0
 /// <summary>
 /// <see cref="XlsxWorksheetHandler"/> を作成する。
 /// </summary>
 /// <param name="styles">書式情報</param>
 /// <param name="sharedStrings">共有文字列情報</param>
 /// <param name="xlsxCellParser">セル処理</param>
 public XlsxWorksheetHandler(XlsxStyles styles, XlsxSharedStrings sharedStrings, XlsxCellParser xlsxCellParser)
 {
     this.styles        = styles;
     this.sharedStrings = sharedStrings;
     this.cellParser    = xlsxCellParser;
 }