Exemple #1
0
        public void GetFormatStringは指定したインデックスの書式を取得できる()
        {
            // setup
            using (FileStream stream = new FileStream(getStylesPath(), FileMode.Open, FileAccess.Read))
            {
                XlsxStyles styles = new XlsxStyles(stream);

                //expect
                Assert.AreEqual("General", styles.GetFormatString(0));
                Assert.AreEqual("m/d/yy", styles.GetFormatString(1));
                Assert.AreEqual("#,##0.0000_ ", styles.GetFormatString(2));
            }
        }
Exemple #2
0
        public void GetFormatIdは指定したインデックスの書式IDを取得できる()
        {
            // setup
            using (FileStream stream = new FileStream(getStylesPath(), FileMode.Open, FileAccess.Read))
            {
                XlsxStyles styles = new XlsxStyles(stream);

                //expect
                Assert.AreEqual(0, styles.GetFormatId(0));
                Assert.AreEqual(14, styles.GetFormatId(1));
                Assert.AreEqual(177, styles.GetFormatId(2));
            }
        }
Exemple #3
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();
     }
 }
 /// <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;
 }
Exemple #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();
     }
 }
Exemple #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;
 }