Пример #1
0
        protected override void DoInitScan()
        {
            if (cachefile == null)
            {
                cachefile = MemoryCacheFile.InitCacheFile();
            }

            AbstractScanner.AddColumn(ListView, "Found Base", 180);
        }
Пример #2
0
        protected override void DoInitScan()
        {
            if (list == null)
            {
                list = new Hashtable();
            }
            else
            {
                list.Clear();
            }

            string WaitingScreenMessage = "";

            if (WaitingScreen.Running)
            {
                WaitingScreenMessage = WaitingScreen.Message;
            }
            if (WaitingScreen.Running)
            {
                WaitingScreen.Message = "Init Cache File";
            }
            if (cachefile == null)
            {
                cachefile = MemoryCacheFile.InitCacheFile();
                cachefile.Save();
                cachefile.Dispose();
                GC.Collect();
                GC.WaitForPendingFinalizers();
                cachefile = null;
                cachefile = MemoryCacheFile.InitCacheFile();
            }

            AbstractScanner.AddColumn(ListView, "GUIDs", 180);
            AbstractScanner.AddColumn(ListView, "Duplicate GUID", 80);
            AbstractScanner.AddColumn(ListView, "First found", 80);

            if (WaitingScreen.Running)
            {
                WaitingScreen.Message = "Create hashtable";
            }
            foreach (MemoryCacheItem mci in cachefile.List)
            {
                string flname = null;
                if (mci.ParentCacheContainer == null)
                {
                    flname = mci.FileDescriptor.Filename;
                }
                else
                {
                    flname = mci.ParentCacheContainer.FileName;
                }
                list[(uint)mci.Guid] = flname.Trim().ToLower();

                /*if (mci.Guid == guid)
                 * {
                 *      if (mci.ParentCacheContainer!=null)
                 *      {
                 *              if (mci.ParentCacheContainer.FileName.Trim().ToLower() != flname)
                 *              {
                 *                      ps.State = TriState.False;
                 *                      break;
                 *              }
                 *      }
                 * }*/
            }
            if (WaitingScreen.Running)
            {
                WaitingScreen.Message = WaitingScreenMessage;
            }
        }