private void InsertLogMessageByDate(ListView.ListViewItemCollection items, LogMessageItem refItem) { // Get previous item var prevItem = refItem; while ((prevItem != null) && !prevItem.Enabled) { prevItem = prevItem.Previous; } var pos = 0; if ((prevItem != null) && (prevItem.Item != null)) { pos = items.IndexOf(prevItem.Item) + 1; } items.Insert(pos, refItem.Item); // Mark the item as enabled refItem.Enabled = true; }
public int IndexOf(ListViewItem item) { return(_collection.IndexOf(item)); }
public Int32 IndexOf(GenericListViewItem <T> item) { return(_items.IndexOf(item)); }