public void Execute()
            {
                while (file != null)
                {
                    GameDataMBIN.Record record = null;

                    var  path = Utils.AbsoluteToRelativePath(RunSettings.GameDataDir, file);
                    bool skip = path.StartsWith("LANGUAGE\\");
                    skip |= path.EndsWith(".MBIN.PC");

                    if (!skip)
                    {
                        long   size = new FileInfo(file).Length;
                        string hash = Utils.SHA1.GetHexString(file);

                        using (var mbin = new MBINFile(file)) {
                            mbin.Load();
                            record = new GameDataMBIN.Record(path, size, hash, mbin.Header);
                        }
                    }

                    file = onFinished(record);
                    Thread.Yield();
                }
            }
 private string OnThreadFinished(GameDataMBIN.Record record)
 {
     lock (this) {
         CurrentState.Finished++;
         if (record != null)
         {
             CurrentState.Table.Add(record);
         }
         return(CurrentState.NextFile());
     }
 }