コード例 #1
0
ファイル: Importer.cs プロジェクト: ministerkrister/Emulators
 protected virtual void OnRomStatusChanged(RomStatusEventArgs e)
 {
     if (RomStatusChanged != null)
         RomStatusChanged(this, e);
 }
コード例 #2
0
 void importer_RomStatusChanged(object sender, RomStatusEventArgs e)
 {
     updateItem(e.RomMatch, e.Status);
 }
コード例 #3
0
 void romStatusChangedHandler(object sender, RomStatusEventArgs e)
 {
     if (e.Status == RomMatchStatus.Committed)
     {
         Game game = EmulatorsCore.Database.Get<Game>(e.RomMatch.ID);
         Logger.LogDebug("Importer action: {0} updated", game.Title);
         UpdateGame(game);
     }
 }
コード例 #4
0
        void importer_RomStatusChanged(object sender, RomStatusEventArgs e)
        {
            if (closing || restarting)
                return;
            if (InvokeRequired)
            {
                try
                {
                    //Make sure we only execute on main thread
                    BeginInvoke(new MethodInvoker(delegate()
                    {
                        importer_RomStatusChanged(sender, e);
                    }));
                }
                catch (ObjectDisposedException) { } //form closed
                return;
            }

            if (closing || restarting)
                return;

            RomMatch romMatch;
            if (e.Status == RomMatchStatus.PendingMatch)
            {
                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.PendingMatch && e.Status != RomMatchStatus.Ignored)
                return;

            refreshRow(rowNum);
            updateButtons();
        }