private void lvMemory_CacheVirtualItems(object sender, CacheVirtualItemsEventArgs e) { do { if (null == this.Image) { break; } UInt32 tStartAddress = (UInt32)e.StartIndex * this.LineSize; Int32 tLength = (e.EndIndex - e.StartIndex + 1) * (Int32)this.LineSize; Byte[] tBuffer = null; if (!this.Image.Read(tStartAddress, ref tBuffer, tLength)) { break; } MemoryBlock tBlock = new MemoryBlock(tStartAddress, tBuffer); ListViewCacheLine tCacheLine = null; for (UInt32 tOffset = 0; tOffset < tBlock.Size; tOffset += this.LineSize) { Byte[] tTempLine = null; UInt32 wAddress = tStartAddress + tOffset; if (!tBlock.Read(wAddress, ref tTempLine, (Int32)this.LineSize)) { continue; } ListViewItem tItem = new ListViewItem(wAddress.ToString("X8")); tItem.SubItems.Add(HEX.HEXBuilder.ByteArrayToHEXString(tTempLine)); tItem.SubItems.Add(BuildDisplayString(tTempLine)); tCacheLine = new ListViewCacheLine(wAddress, tItem); m_ListViewCache.Add(tCacheLine); } m_ListViewCache.RemoveBefore(tStartAddress.ToString("X8")); m_ListViewCache.RemoveAfter(tCacheLine.ID); } while (false); }