Ejemplo n.º 1
0
 void romStatusChangedHandler(object sender, RomStatusChangedEventArgs e)
 {
     if (e.Status == RomMatchStatus.Committed)
     {
         Game game = DB.Instance.GetGame(e.RomMatch.ID);
         Logger.LogDebug("Importer action: {0} updated", game.Title);
         UpdateGame(game);
     }
 }
Ejemplo n.º 2
0
        void importer_RomStatusChanged(object sender, RomStatusChangedEventArgs e)
        {
            if (InvokeRequired)
            {
                //Make sure we only execute on main thread
                BeginInvoke(new MethodInvoker(delegate()
                {
                    importer_RomStatusChanged(sender, e);
                }
                                              ));
                return;
            }

            if (closing || restarting)
            {
                return;
            }

            RomMatch romMatch;

            if (e.Status == RomMatchStatus.PendingHash)
            {
                romMatch = e.RomMatch;
                if (!checkRow(romMatch)) //if false, add a new row
                {
                    addRow(romMatch);
                    return;
                }
            }
            else if (e.Status == RomMatchStatus.Ignored || e.Status == RomMatchStatus.Removed)
            {
                importerBindingSource.Remove(e.RomMatch);
                return;
            }

            int rowNum = importerBindingSource.IndexOf(e.RomMatch);

            if (rowNum < 0) //match not in grid
            {
                return;
            }

            romMatch = e.RomMatch;
            if (romMatch.Status == RomMatchStatus.Ignored && e.Status != RomMatchStatus.PendingHash && e.Status != RomMatchStatus.Ignored)
            {
                return;
            }

            refreshRow(rowNum);
            updateButtons();
        }