예제 #1
0
        void updateButtons()
        {
            if (importGridView.SelectedRows.Count == 0)
            {
                return;
            }
            else if (importGridView.SelectedRows.Count > 1)
            {
                approveButton.Enabled = true;
                findButton.Enabled    = false;
                mergeButton.Image     = MyEmulators2.Properties.Resources.arrow_join;
                importToolTip.SetToolTip(mergeButton, "Merge into multi-disc game");
                mergeButton.Enabled = true;
                return;
            }
            findButton.Enabled = true;

            RomMatch       match  = importGridView.SelectedRows[0].DataBoundItem as RomMatch;
            RomMatchStatus status = match.Status;

            if (match.IsMultiFile)
            {
                mergeButton.Image = MyEmulators2.Properties.Resources.arrow_divide;
                importToolTip.SetToolTip(mergeButton, "Split multi-disc game");
                mergeButton.Enabled = true;
            }
            else
            {
                mergeButton.Image = MyEmulators2.Properties.Resources.arrow_join;
                importToolTip.SetToolTip(mergeButton, "Merge into multi-disc game");
                mergeButton.Enabled = false;
            }

            //Allow approve only if match has been checked and not ignored
            if ((status == RomMatchStatus.Approved || status == RomMatchStatus.NeedsInput) && importGridView.SelectedRows[0].Cells[columnTitle.Name].Value != null)
            {
                approveButton.Enabled = true;
            }
            else
            {
                approveButton.Enabled = false;
            }
        }
예제 #2
0
 public RomStatusEventArgs(RomMatch romMatch, RomMatchStatus status)
 {
     RomMatch = romMatch;
     Status = status;
 }
예제 #3
0
 void setRomStatus(RomMatch romMatch, RomMatchStatus status)
 {
     if (ImporterStatus == ImportAction.ImportRestarting)
         return;
     OnRomStatusChanged(new RomStatusEventArgs(romMatch, status));
 }
예제 #4
0
        void addToList(RomMatch romMatch, RomMatchStatus newStatus, List<RomMatch> list, List<RomMatch> priorityList)
        {
            lock (romMatch.SyncRoot)
            {
                if (!romMatch.OwnedByThread())
                    return;
                romMatch.CurrentThreadId = null;
                romMatch.Status = newStatus;

                if (priorityList != null && romMatch.HighPriority)
                    lock (priorityList)
                        priorityList.Add(romMatch);
                else if (list != null)
                    lock (list)
                        list.Add(romMatch);
                setRomStatus(romMatch, newStatus);
            }
        }
예제 #5
0
 void updateItem(RomMatch romMatch, RomMatchStatus newStatus)
 {
     lock (syncRoot)
     {
         RomMatchViewModel model;
         if (itemsDictionary.TryGetValue(romMatch.ID, out model))
         {
             if (newStatus == RomMatchStatus.Ignored || newStatus == RomMatchStatus.Removed)
             {
                 itemsDictionary.Remove(romMatch.ID);
                 items.Remove(model);
             }
             else
             {
                 model.Update();
                 return;
             }
         }
         else
         {
             model = new RomMatchViewModel(romMatch);
             itemsDictionary[romMatch.ID] = model;
             items.Add(model);
         }
     }
     items.FireChange();
 }