コード例 #1
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         int cnt = 0;
         _sstDoc = SstDocument.Parse(is1);
         CT_Sst sst = _sstDoc.GetSst();
         count       = (int)sst.count;
         uniqueCount = (int)sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key = GetKey(st);
             if (key != null && !stmap.ContainsKey(key))
             {
                 stmap.Add(key, cnt);
             }
             strings.Add(st);
             cnt++;
         }
     }
     catch (XmlException e)
     {
         throw new IOException(e.Message);
     }
 }
コード例 #2
0
ファイル: SharedStringsTable.cs プロジェクト: zzy092/npoi
 public void ReadFrom(Stream is1)
 {
     try
     {
         int         cnt = 0;
         XmlDocument xml = ConvertStreamToXml(is1);
         _sstDoc = SstDocument.Parse(xml, NamespaceManager);
         CT_Sst sst = _sstDoc.GetSst();
         count       = (int)sst.count;
         uniqueCount = (int)sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key = GetKey(st);
             if (key != null && !stmap.ContainsKey(key))
             {
                 stmap.Add(key, cnt);
             }
             strings.Add(st);
             cnt++;
         }
     }
     catch (XmlException e)
     {
         throw new IOException("unable to parse shared strings table", e);
     }
 }
コード例 #3
0
 public void ReadFrom(Stream is1)
 {
     try
     {
         int num = 0;
         this._sstDoc = SstDocument.Parse(is1);
         CT_Sst sst = this._sstDoc.GetSst();
         this.count       = sst.count;
         this.uniqueCount = sst.uniqueCount;
         foreach (CT_Rst st in sst.si)
         {
             string key = this.GetKey(st);
             if (key != null && !this.stmap.ContainsKey(key))
             {
                 this.stmap.Add(key, num);
             }
             this.strings.Add(st);
             ++num;
         }
     }
     catch (XmlException ex)
     {
         throw new IOException(ex.Message);
     }
 }
コード例 #4
0
ファイル: SharedStringsTable.cs プロジェクト: zbl960/npoi
        public void ReadFrom(XmlDocument xml)
        {
            int cnt = 0;

            _sstDoc = SstDocument.Parse(xml, NamespaceManager);
            CT_Sst sst = _sstDoc.GetSst();

            count       = (int)sst.count;
            uniqueCount = (int)sst.uniqueCount;
            foreach (CT_Rst st in sst.si)
            {
                string key = GetKey(st);
                if (key != null && !stmap.ContainsKey(key))
                {
                    stmap.Add(key, cnt);
                }
                strings.Add(st);
                cnt++;
            }
        }