Пример #1
0
 private void PollRemote()
 {
     Logger.Debug("Checking Remote");
     foreach (SaveFileHandler handler in SaveFiles)
     {
         if (ProcessUtility.IsProcessActive(handler.ExecutableName))
         {
             Logger.Debug($"Holding off sync (Remote) for {handler.LocalSaveFile.GameTitle} because game is active");
             continue;
         }
         if (m_syncQueue.Contains(handler))
         {
             Logger.Debug($"Holding off sync (Remote) for {handler.LocalSaveFile.GameTitle} because the game is already in local syncing queue");
             continue;
         }
         this.ExecuteSyncAction(handler, this.DetermineSyncAction(handler));
         Thread.Sleep(1000);
     }
 }
Пример #2
0
        private void PollQueue()
        {
            Logger.Debug("Polling Queue");
            foreach (SaveFileHandler handler in this.m_syncQueue)
            {
                Logger.Trace($"Processing: {handler.LocalSaveFile.GameTitle}");
                if (ProcessUtility.IsProcessActive(handler.ExecutableName))
                {
                    Logger.Debug($"Holding off sync (Local) for {handler.LocalSaveFile.GameTitle} because game is active");
                }
                else
                {
                    this.ExecuteSyncAction(handler, this.DetermineSyncAction(handler));

                    // We are modifying collection here,
                    // and iteration can't continue after that
                    // so breakout early
                    this.m_syncQueue.Remove(handler);
                    return;
                }
            }
        }