本文整理汇总了C#中RecordReader.ReadRecordAt方法的典型用法代码示例。如果您正苦于以下问题:C# RecordReader.ReadRecordAt方法的具体用法?C# RecordReader.ReadRecordAt怎么用?C# RecordReader.ReadRecordAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecordReader
的用法示例。
在下文中一共展示了RecordReader.ReadRecordAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: LoadSingleForm
private static void LoadSingleForm(Form form, RecordReader reader, SharedData sharedData)
{
// Skip if record has been already loaded
// unless it has been loaded lazily and current loading scheme is lazy again
if (form.Record != null && (!form.IsLazyLoaded || sharedData.LazyLoading))
{
Interlocked.Increment(ref sharedData.Skipped);
}
else
{
if (sharedData.LazyLoading)
{
form.Flags |= FormFlags.LazyLoaded;
}
else
{
form.Flags &= ~FormFlags.LazyLoaded;
}
form.Record = sharedData.Plugin.Context.CreateGenericFormRecord(form.FormKind);
reader.ReadRecordAt(form.FilePosition, form.Record, sharedData.LazyLoading);
sharedData.LastFormLoaded = form;
if (form.IsDummyRecord)
Interlocked.Increment(ref sharedData.Unsupported);
Interlocked.Increment(ref sharedData.Loaded);
}
}