本文整理汇总了C#中NPOI.HSSF.Record.Record类的典型用法代码示例。如果您正苦于以下问题:C# Record类的具体用法?C# Record怎么用?C# Record使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Record类属于NPOI.HSSF.Record命名空间,在下文中一共展示了Record类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomViewSettingsRecordAggregate
public CustomViewSettingsRecordAggregate(RecordStream rs)
{
_begin = rs.GetNext();
if (_begin.Sid != UserSViewBegin.sid)
{
throw new InvalidOperationException("Bad begin record");
}
List<RecordBase> temp = new List<RecordBase>();
while (rs.PeekNextSid() != UserSViewEnd.sid)
{
if (PageSettingsBlock.IsComponentRecord(rs.PeekNextSid()))
{
if (_psBlock != null)
{
throw new InvalidOperationException(
"Found more than one PageSettingsBlock in custom view Settings sub-stream");
}
_psBlock = new PageSettingsBlock(rs);
temp.Add(_psBlock);
continue;
}
temp.Add(rs.GetNext());
}
_recs = temp;
_end = rs.GetNext(); // no need to save EOF in field
if (_end.Sid != UserSViewEnd.sid)
{
throw new InvalidOperationException("Bad custom view Settings end record");
}
}
示例2: ProcessRecord
/**
* Process this record ourselves, and then
* pass it on to our child listener
*/
public void ProcessRecord(Record record)
{
// Handle it ourselves
ProcessRecordInternally(record);
// Now pass on to our child
childListener.ProcessRecord(record);
}
示例3: ProcessRecord
public bool ProcessRecord(Record rec)
{
wascalled[0] = true;
Assert.IsTrue(
(rec.Sid == BOFRecord.sid),
"must be BOFRecord got SID=" + rec.Sid);
return true;
}
示例4: ProcessRecord
/**
* sends the record event to all registered listeners.
* @param record the record to be thrown.
* @return <c>false</c> to abort. This aborts
* out of the event loop should the listener return false
*/
private bool ProcessRecord(Record record)
{
if (!IsSidIncluded(record.Sid))
{
return true;
}
return _listener.ProcessRecord(record);
}
示例5: ProcessRecord
public void ProcessRecord(Record record)
{
if (record is AlRunsRecord)
{
chartTitleFormatRecords.Add(
record
);
}
}
示例6: RecordTreeNode
public RecordTreeNode(Record record)
{
if (record is ObjRecord)
{
ObjRecord or = (ObjRecord)record;
IList subrecs=or.SubRecords;
foreach (SubRecord sr in subrecs)
{
this.Nodes.Add(new SubRecordTreeNode(sr));
}
this.ImageKey = "Folder";
this.SelectedImageKey = "Folder";
}
else if (record is SSTRecord)
{
IEnumerator strings = ((SSTRecord)record).GetStrings();
this.ImageKey = "Folder";
this.SelectedImageKey = "Folder";
while (strings.MoveNext())
{
this.Nodes.Add(new UnicodeStringTreeNode((UnicodeString)strings.Current));
}
}
else if (record is DrawingGroupRecord)
{
this.ImageKey = "Folder";
this.SelectedImageKey = "Folder";
DrawingGroupRecord dgr = (DrawingGroupRecord)record;
for (int i = 0; i < dgr.EscherRecords.Count; i++)
{
this.Nodes.Add(new EscherRecordTreeNode((NPOI.DDF.EscherRecord)dgr.EscherRecords[i]));
}
}
else
{
this.ImageKey = "Binary";
}
if (record is UnknownRecord)
{
this.Text = UnknownRecord.GetBiffName(record.Sid) + "*";
}
else
{
this.Text = record.GetType().Name;
}
this.Record = record;
}
示例7: ProcessRecordInternally
/**
* Process the record ourselves, but do not
* pass it on to the child Listener.
* @param record
*/
public void ProcessRecordInternally(Record record)
{
if (record is FormatRecord)
{
FormatRecord fr = (FormatRecord)record;
customFormatRecords[fr.IndexCode] = fr;
}
else if (record is ExtendedFormatRecord)
{
ExtendedFormatRecord xr = (ExtendedFormatRecord)record;
xfRecords.Add(xr);
}
}
示例8: Add
/// <summary>
/// Adds the specified pos.
/// </summary>
/// <param name="pos">The pos.</param>
/// <param name="r">The r.</param>
public void Add(int pos, Record r)
{
records.Insert(pos, r);
if (Protpos >= pos) Protpos=(protpos + 1);
if (Bspos >= pos) Bspos=(bspos + 1);
if (Tabpos >= pos) Tabpos=(tabpos + 1);
if (Fontpos >= pos) Fontpos=(fontpos + 1);
if (Xfpos >= pos) Xfpos=(xfpos + 1);
if (Backuppos >= pos) Backuppos=(backuppos + 1);
if (Namepos>= pos) Namepos=(namepos + 1);
if (Supbookpos >= pos) Supbookpos=(supbookpos + 1);
if ((Palettepos!= -1) && (Palettepos>= pos)) Palettepos=(palettepos + 1);
if (ExternsheetPos >= pos) ExternsheetPos=ExternsheetPos + 1;
}
示例9: Dispose
public override void Dispose()
{
_rowBreaksRecord = null;
_columnBreaksRecord = null;
header = null;
footer = null;
_hCenter = null;
_vCenter = null;
_leftMargin = null;
_rightMargin = null;
_topMargin = null;
_bottomMargin = null;
_pls = null;
printSetup = null;
_bitmap = null;
}
示例10: ProcessRecord
//ERFListener
public bool ProcessRecord(Record rec)
{
if (rec.Sid == BOFRecord.sid)
{
if (lastEOF != true)
{
throw new Exception("Not yet handled embedded models");
}
else
{
BOFRecord bof = (BOFRecord)rec;
switch (bof.Type)
{
case BOFRecord.TYPE_WORKBOOK:
currentmodel = new Workbook();
break;
case BOFRecord.TYPE_WORKSHEET:
currentmodel = Sheet.CreateSheet();
break;
default:
throw new Exception("Unsupported model type " + bof.GetType());
}
}
}
if (rec.Sid == EOFRecord.sid)
{
lastEOF = true;
ThrowEvent(currentmodel);
}
else
{
lastEOF = false;
}
return true;
}
示例11: VisitRecord
public void VisitRecord(Record r)
{
if (r.Sid == UserSViewBegin.sid)
{
String guid = HexDump.ToHex(((UserSViewBegin) r).Guid);
HeaderFooterRecord hf = _hfGuidMap[guid];
if (hf != null)
{
{
_cv.Append(_hf);
_sviewHeaderFooters.Remove(_hf);
}
}
}
}
示例12: ReadARecord
private bool ReadARecord(RecordStream rs)
{
switch (rs.PeekNextSid())
{
case HorizontalPageBreakRecord.sid:
CheckNotPresent(_rowBreaksRecord);
_rowBreaksRecord = (PageBreakRecord)rs.GetNext();
break;
case VerticalPageBreakRecord.sid:
CheckNotPresent(_columnBreaksRecord);
_columnBreaksRecord = (PageBreakRecord)rs.GetNext();
break;
case HeaderRecord.sid:
CheckNotPresent(header);
header = (HeaderRecord)rs.GetNext();
break;
case FooterRecord.sid:
CheckNotPresent(footer);
footer = (FooterRecord)rs.GetNext();
break;
case HCenterRecord.sid:
CheckNotPresent(_hCenter);
_hCenter = (HCenterRecord)rs.GetNext();
break;
case VCenterRecord.sid:
CheckNotPresent(_vCenter);
_vCenter = (VCenterRecord)rs.GetNext();
break;
case LeftMarginRecord.sid:
CheckNotPresent(_leftMargin);
_leftMargin = (LeftMarginRecord)rs.GetNext();
break;
case RightMarginRecord.sid:
CheckNotPresent(_rightMargin);
_rightMargin = (RightMarginRecord)rs.GetNext();
break;
case TopMarginRecord.sid:
CheckNotPresent(_topMargin);
_topMargin = (TopMarginRecord)rs.GetNext();
break;
case BottomMarginRecord.sid:
CheckNotPresent(_bottomMargin);
_bottomMargin = (BottomMarginRecord)rs.GetNext();
break;
case UnknownRecord.PLS_004D: // PLS
_plsRecords.Add(new PLSAggregate(rs));
break;
case PrintSetupRecord.sid:
CheckNotPresent(printSetup);
printSetup = (PrintSetupRecord)rs.GetNext();
break;
case UnknownRecord.BITMAP_00E9: // BITMAP
CheckNotPresent(_bitmap);
_bitmap = rs.GetNext();
break;
case PrintSizeRecord.sid:
CheckNotPresent(_printSize);
_printSize = rs.GetNext();
break;
case HeaderFooterRecord.sid:
HeaderFooterRecord hf = (HeaderFooterRecord)rs.GetNext();
if (hf.IsCurrentSheet)
_headerFooter = hf;
else
_sviewHeaderFooters.Add(hf);
break;
default:
// all other record types are not part of the PageSettingsBlock
return false;
}
return true;
}
示例13: VisitRecord
public void VisitRecord(Record r)
{
if (r is LabelSSTRecord)
{
_count++;
}
}
示例14: ProcessRecordInternally
/// <summary>
/// Process the record ourselves, but do not
/// pass it on to the child Listener.
/// </summary>
/// <param name="record">The record.</param>
public void ProcessRecordInternally(Record record)
{
if (record is BoundSheetRecord)
{
boundSheetRecords.Add(record);
}
else if (record is ExternSheetRecord)
{
externSheetRecords.Add(record);
}
else if (record is SSTRecord)
{
sstRecord = (SSTRecord)record;
}
}
示例15: VisitRecord
public void VisitRecord(Record r) {
if (r is MergeCellsRecord) {
_count++;
}
}