Exemplo n.º 1
0
        protected override void DoInitScan()
        {
            if (cachefile == null)
            {
                cachefile = MemoryCacheFile.InitCacheFile();
            }

            AbstractScanner.AddColumn(ListView, "Found Base", 180);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates and Loads the Memory Cache
        /// </summary>
        /// <returns></returns>
        public static MemoryCacheFile InitCacheFile(SimPe.Interfaces.Scenegraph.IScenegraphFileIndex fileindex)
        {
            Wait.SubStart();
            Wait.Message = "Loading Memorycache";

            MemoryCacheFile cachefile = new MemoryCacheFile();

            cachefile.Load(Helper.SimPeLanguageCache, true);
            cachefile.ReloadCache(fileindex, true);
            Wait.SubStop();

            return(cachefile);
        }
Exemplo n.º 3
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;
            }
        }