private void CreateCache(int startIndex, int endIndex)
{
var tabInfo = this._statuses.Tabs[this._curTab.Text];
if (tabInfo.AllCount == 0)
return;
// キャッシュ要求(要求範囲±30を作成)
startIndex = Math.Max(startIndex - 30, 0);
endIndex = Math.Min(endIndex + 30, tabInfo.AllCount - 1);
var cacheLength = endIndex - startIndex + 1;
var posts = tabInfo[startIndex, endIndex]; //配列で取得
var listItems = Enumerable.Range(0, cacheLength)
.Select(x => this.CreateItem(this._curTab, posts[x], startIndex + x))
.ToArray();
var listCache = new ListViewItemCache
{
TargetList = this._curList,
StartIndex = startIndex,
EndIndex = endIndex,
Post = posts,
ListItem = listItems,
};
Interlocked.Exchange(ref this._listItemCache, listCache);
}