private string OnThreadFinished(GameDataFile.Record record)
 {
     lock (this) {
         CurrentState.Finished++;
         if (record != null)
         {
             CurrentState.Table.Add(record);
         }
         return(CurrentState.NextFile());
     }
 }
            public void Execute()
            {
                while (file != null)
                {
                    GameDataFile.Record record = null;

                    var  path = Utils.AbsoluteToRelativePath(RunSettings.GameDataDir, file);
                    bool skip = path.StartsWith("PCBANKS\\");
                    skip |= path.StartsWith("SHADERCACHE\\");

                    if (!skip)
                    {
                        long   size = new FileInfo(file).Length;
                        string hash = Utils.SHA1.GetHexString(file);
                        record = new GameDataFile.Record(path, size, hash);
                    }

                    file = onFinished(record);
                    Thread.Yield();
                }
            }