本文整理汇总了C#中RecordReader.ReadHeader方法的典型用法代码示例。如果您正苦于以下问题:C# RecordReader.ReadHeader方法的具体用法?C# RecordReader.ReadHeader怎么用?C# RecordReader.ReadHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordReader
的用法示例。
在下文中一共展示了RecordReader.ReadHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PluginInspector
public PluginInspector(DataContext context, DataFile file)
{
Log.Info("Inspecting records in plugin {0}", file.Name);
using (var reader = new RecordReader(file.Open(), context))
{
var header = reader.ReadHeader();
int masters = header.GetMasterFiles().Count();
byte newRecordPluginNumber = (byte)masters;
foreach (var entry in reader.FindRecordsAsync())
{
index.Add(entry.FilePosition, entry.FormId);
}
long newForms = 0;
long done = 0;
using (var progress = Display.StartProgress("Inspecting records"))
{
foreach (var item in index)
{
if (item.Value >> 24 == newRecordPluginNumber)
{
// Read only the bare minimum of form data (such as EditorID)
var record = new DummyRecord();
reader.ReadRecordAt(item.Key, record, true);
if (!string.IsNullOrEmpty(record.EditorId))
{
var formId = item.Value & 0xFFFFFF;
Log.Fine("Found new record {0:X8} '{1}'", formId, record.EditorId);
newRecords.Add(new RecordInfo()
{
FormId = formId,
EditorId = record.EditorId
});
}
newForms++;
}
done++;
progress.Update(done, index.Count, file.Name);
}
}
Log.Info("Found {0} records out of which {1} are new records.", index.Count, newForms);
}
}