本文整理汇总了C#中Report.GetObject方法的典型用法代码示例。如果您正苦于以下问题:C# Report.GetObject方法的具体用法?C# Report.GetObject怎么用?C# Report.GetObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report.GetObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessHistoryDataBlock
private bool ProcessHistoryDataBlock(IEnumerable<byte> dataBytes)
{
var endOfStreamFound = false;
var data = dataBytes.ToArray();
for (var b = 0; b < DataReadLength; b += HistoryDataBlockLength)
{
var dataBlock = data.Skip(b).Take(HistoryDataBlockLength).ToArray();
// If we find an "empty" data row, we are done.
if (dataBlock.All(e => e == 0xFF))
{
endOfStreamFound = true;
break;
}
var report = new Report(HistoryDataBlockLength);
report.AddRawData(dataBlock);
var historyData = report.GetObject<HistoryData>();
_history.Add(historyData);
OnHistoryData(this, historyData);
}
return !endOfStreamFound;
}
示例2: DownloadSettings
private void DownloadSettings()
{
var report = new Report(SettingsEndAddress - SettingsStartAddress);
// Download settings from 0000h-0100h
for (var a = SettingsStartAddress; a <= SettingsEndAddress; a += DataReadLength)
{
DownloadBlock(a, d =>
{
report.AddRawData(d);
return true;
});
}
// Create data object from report
Settings = report.GetObject<Settings>();
OnSettingsLoaded(this, Settings);
}