private static void ApplyCache(List <ApplicationUninstallerEntry> baseEntries, ApplicationUninstallerFactoryCache cache, InfoAdderManager infoAdder)
 {
     foreach (var entry in baseEntries)
     {
         var matchedEntry = cache.TryGetCachedItem(entry);
         if (matchedEntry != null)
         {
             infoAdder.CopyMissingInformation(entry, matchedEntry);
         }
     }
 }
Exemplo n.º 2
0
        private static void ApplyCache(ICollection <ApplicationUninstallerEntry> baseEntries, ApplicationUninstallerFactoryCache cache, InfoAdderManager infoAdder)
        {
            var hits = 0;

            foreach (var entry in baseEntries)
            {
                var matchedEntry = cache.TryGetCachedItem(entry);
                if (matchedEntry != null)
                {
                    infoAdder.CopyMissingInformation(entry, matchedEntry);
                    hits++;
                }
                else
                {
                    Debug.WriteLine("Cache miss: " + entry.DisplayName);
                }
            }
            Console.WriteLine($@"Cache hits: {hits}/{baseEntries.Count}");
        }