當前位置: 首頁>>代碼示例>>C#>>正文


C# RecordStream.GetCountRead方法代碼示例

本文整理匯總了C#中NPOI.HSSF.Model.RecordStream.GetCountRead方法的典型用法代碼示例。如果您正苦於以下問題:C# RecordStream.GetCountRead方法的具體用法?C# RecordStream.GetCountRead怎麽用?C# RecordStream.GetCountRead使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NPOI.HSSF.Model.RecordStream的用法示例。


在下文中一共展示了RecordStream.GetCountRead方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestStartBlock_EndBlock_Write

        public void TestStartBlock_EndBlock_Write()
        {
            HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("chartdemo.xls");
            Record[] sheetRecs = RecordInspector.GetRecords(wb.GetSheetAt(0), 0);

            RecordStream rs = new RecordStream(Arrays.AsList(sheetRecs), 0);

            rs.FindChartSubStream();
            int pos = rs.GetCountRead();

            ChartSheetAggregate csAgg = new ChartSheetAggregate(rs, null);
            RecordInspector.RecordCollector rv = new RecordInspector.RecordCollector();
            csAgg.VisitContainedRecords(rv);
            Record[] outRecs = rv.Records;
            for (int i = 0; i < outRecs.Length; i++)
            {
                Assert.AreEqual(sheetRecs[pos + i].GetType(), outRecs[i].GetType());
            }
        }
開發者ID:JnS-Software-LLC,項目名稱:npoi,代碼行數:19,代碼來源:TestChartSheetAggregate.cs

示例2: LinkTable

        private WorkbookRecordList _workbookRecordList; // TODO - would be nice to Remove this

        public LinkTable(List<Record> inputList, int startIndex, WorkbookRecordList workbookRecordList, Dictionary<String, NameCommentRecord> commentRecords)
        {

            _workbookRecordList = workbookRecordList;
            RecordStream rs = new RecordStream(inputList, startIndex);

            ArrayList temp = new ArrayList();
            while (rs.PeekNextClass() == typeof(SupBookRecord))
            {
                temp.Add(new ExternalBookBlock(rs));
            }

            //_externalBookBlocks = new ExternalBookBlock[temp.Count];
            _externalBookBlocks = (ExternalBookBlock[])temp.ToArray(typeof(ExternalBookBlock));
            temp.Clear();

            if (_externalBookBlocks.Length > 0)
            {
                // If any ExternalBookBlock present, there is always 1 of ExternSheetRecord
                if (rs.PeekNextClass() != typeof(ExternSheetRecord))
                {
                    // not quite - if written by google docs
                    _externSheetRecord = null;
                }
                else
                {
                    _externSheetRecord = ReadExtSheetRecord(rs);
                }
            }
            else
            {
                _externSheetRecord = null;
            }

            _definedNames = new List<NameRecord>();
            // collect zero or more DEFINEDNAMEs id=0x18
            while (true)
            {

                Type nextClass = rs.PeekNextClass();
                if (nextClass == typeof(NameRecord))
                {
                    NameRecord nr = (NameRecord)rs.GetNext();
                    _definedNames.Add(nr);
                }
                else if (nextClass == typeof(NameCommentRecord))
                {
                    NameCommentRecord ncr = (NameCommentRecord)rs.GetNext();
                    //commentRecords.Add(ncr.NameText, ncr);
                    commentRecords[ncr.NameText] = ncr;
                }
                else
                {
                    break;
                }
            }

            _recordCount = rs.GetCountRead();
            for (int i = startIndex; i < startIndex + _recordCount; i++)
            {
                _workbookRecordList.Records.Add(inputList[i]);
            }

        }
開發者ID:Reinakumiko,項目名稱:npoi,代碼行數:66,代碼來源:LinkTable.cs

示例3: LinkTable

        private WorkbookRecordList _workbookRecordList; // TODO - would be nice to Remove this

        public LinkTable(IList inputList, int startIndex, WorkbookRecordList workbookRecordList)
        {

            _workbookRecordList = workbookRecordList;
            RecordStream rs = new RecordStream(inputList, startIndex);

            ArrayList temp = new ArrayList();
            while (rs.PeekNextClass() == typeof(SupBookRecord))
            {
                temp.Add(new ExternalBookBlock(rs));
            }

            //_externalBookBlocks = new ExternalBookBlock[temp.Count];
            _externalBookBlocks=(ExternalBookBlock[])temp.ToArray(typeof(ExternalBookBlock));
            temp.Clear();

            if (_externalBookBlocks.Length > 0)
            {
                // If any ExternalBookBlock present, there Is always 1 of ExternSheetRecord
                Record next = rs.GetNext();
                _externSheetRecord = (ExternSheetRecord)next;
            }
            else
            {
                _externSheetRecord = null;
            }

            _definedNames = new ArrayList();
            // collect zero or more DEFINEDNAMEs id=0x18
            while (rs.PeekNextClass() == typeof(NameRecord))
            {
                NameRecord nr = (NameRecord)rs.GetNext();
                _definedNames.Add(nr);
            }

            _recordCount = rs.GetCountRead();
            for(int i=startIndex;i< startIndex + _recordCount;i++)
            {
                _workbookRecordList.Records.Add(inputList[i]);
            }
            
        }
開發者ID:ChiangHanLung,項目名稱:PIC_VDS,代碼行數:44,代碼來源:LinkTable.cs


注:本文中的NPOI.HSSF.Model.RecordStream.GetCountRead方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。