protected readonly ImageCache imageCache;
protected readonly string imageUrl;
+ /// <summary>
+ /// 状態表示に使用するアイコンのインデックスを取得・設定する。
+ /// </summary>
+ /// <remarks>
+ /// StateImageIndex は不必要な処理が挟まるため、使用しないようにする。
+ /// </remarks>
+ public int StateIndex { get; set; }
+
private WeakReference imageReference = new WeakReference(null);
private Task imageTask = null;
}
public ImageListViewItem(string[] items, ImageCache imageCache, string imageUrl)
- : base(items, imageUrl)
+ : base(items)
{
this.imageCache = imageCache;
this.imageUrl = imageUrl;
+ this.StateIndex = -1;
if (imageCache != null)
{
Post.Source};
itm = new ImageListViewItem(sitem, this.IconCache, Post.ImageUrl);
}
- itm.StateImageIndex = Post.StateIndex;
+ itm.StateIndex = Post.StateIndex;
bool read = Post.IsRead;
//未読管理していなかったら既読として扱う
//iconRect.Offset(0, Math.Max(0, (itemRect.Height - realIconSize.Height) / 2));
}
- if (item.StateImageIndex > -1)
+ if (item.StateIndex > -1)
{
Rectangle stateRect = Rectangle.Intersect(new Rectangle(new Point(iconRect.X + realIconSize.Width + 2, iconRect.Y), realStateSize), itemRect);
if (stateRect.Width > 0)
{
//e.Graphics.FillRectangle(Brushes.White, stateRect);
//e.Graphics.InterpolationMode = Drawing2D.InterpolationMode.High;
- e.Graphics.DrawImage(this.PostStateImageList.Images[item.StateImageIndex], stateRect);
+ e.Graphics.DrawImage(this.PostStateImageList.Images[item.StateIndex], stateRect);
}
}
}