Exemplo n.º 1
0
        private void RelevanceData()
        {
            var    libItemsCount = lvLibItems.Items.Count;
            double step          = libItemsCount / 100;

            var time = DateTime.Now;

            log.Write($"{ time.ToString() }");
            log.Write($"> Find relevance where libItems count = {lvLibItems.Items.Count} ");

            // var relevance = new Relevance(lvLibItems.Items.Cast<ListViewItem>().Select(item => (LibItem)item.Tag).ToList());
            var relevance      = new Relevance(libItems);
            var relevanceItems = relevance.GetRelevance();

            deletedLibItems.AddRange(libItems.Except(relevanceItems).ToList());
            libItems = relevanceItems;
            LoadLibItems();

            log.Write($"{ (DateTime.Now - time).TotalSeconds.ToString() } sec.");
            log.Write("____________________");

            pbLoadUniqueData.Value = 100;
            MessageBox.Show("Готово!");
            pbLoadUniqueData.Value = 0;
        }