private void UpdateList() { int itemCount = 0; long logPosts = 0; string filter = m_Filter.Text.ToLower().Trim(); m_ItemsList.ListViewItemSorter = null; m_ItemsList.BeginUpdate(); m_ItemsList.Items.Clear(); foreach (string itemID in m_Database.GetItemsIDs()) { if (filter.Length > 0 && !itemID.ToLower().Contains(filter)) { continue; } ListViewItem item = new ListViewItem(itemID); int posts = m_Database.GetItemRowCount(itemID); item.SubItems.Add(posts.ToString()); m_ItemsList.Items.Add(item); itemCount++; logPosts += posts; } m_ItemsList.EndUpdate(); m_ItemsList.ListViewItemSorter = m_Sorter; m_ItemsList.Sort(); Text = Text + string.Format(" ({0} unique items, {1} log posts)", itemCount, logPosts); }
private void ItemDatabaseOnInitialReadDone(object sender, EventArgs e) { var itemsIDs = m_ItemDatabase.GetItemsIDs().ToList(); CurveList .Select(x => (string)x.Tag) .Where(x => !itemsIDs.Contains(x)) .ToList() .ForEach(RemoveItem); }