Exemplo n.º 1
0
        private void CleanAfterOperation(OperationBase operation)
        {
            operation.Finished -= operation_Finished;
            if (operation.IsComplexOperation)
            {
                operation.Progressed -= operation_Progressed;
            }

            WpfUtilities.ThreadSafeInvoke(() => Pending.Remove(operation));
            CheckOngoingOperations();
        }
Exemplo n.º 2
0
 public void NextCharacter()
 {
     if (Roster.Count == 0)
     {
         return;
     }
     if (Pending.Count == 0)
     {
         NewRound();
         return;
     }
     Done.Insert(0, Current);
     Current = Pending[0];
     Pending.Remove(Current);
     return;
 }
Exemplo n.º 3
0
        private void MoveToArchive(TransmittalVM trans)
        {
            var file = trans.File;

            file.MoveTo(ArchivePath(file));

            _ui.Send(x => Archive.Add(file.Name), null);
            if (Archive.Count > MAX_ARCHIVE)
            {
                _ui.Send(x => Archive.RemoveAt(0), null);
            }

            //OnGoing.Remove(trans);
            _ui.Send(x => OnGoing.Remove(trans), null);
            //Pending.Remove(file);
            _ui.Send(x => Pending.Remove(file), null);
        }
Exemplo n.º 4
0
 private void RemoveUserFromMemory(FriendModel user)
 {
     if (Friends.Contains(user))
     {
         Friends.Remove(user);
         UserFriendsUpdatedEvent?.Invoke();
     }
     if (Pending.Contains(user))
     {
         Pending.Remove(user);
         PendingUsersUpdatedEvent?.Invoke();
     }
     if (Requested.Contains(user))
     {
         Requested.Remove(user);
         RequestedUsersUpdatedEvent?.Invoke();
     }
     if (Blocked.Contains(user))
     {
         Blocked.Remove(user);
         BlockedUsersUpdatedEvent?.Invoke();
     }
 }
Exemplo n.º 5
0
 public void Remove(T newVal)
 {
     Pending.Remove(newVal);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Occurs when a contained JobViewModel has finished
 /// </summary>
 /// <param name="sender">The JobViewModel</param>
 /// <param name="e">N/A</param>
 private void _jobFinished(object sender, EventArgs e)
 {
     Current = null;
     _safeViewModelAction(x => Pending.Remove(x), (JobViewModel)sender);
     _safeViewModelAction(Finished.Add, (JobViewModel)sender);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Occurs when a contained JobViewModel has begun
 /// </summary>
 /// <param name="sender">The JobViewModel</param>
 /// <param name="e">N/A</param>
 private void _jobStarted(object sender, EventArgs e)
 {
     Current = (JobViewModel)sender;
     _safeViewModelAction(x => Pending.Remove(x), Current);
 }