示例#1
0
        public void ExecuteOperation(OperationBase operation)
        {
            Pending.Add(operation);
            operation.Finished += operation_Finished;
            operation.Error += operation_Error;
            if (operation.IsComplexOperation)
                operation.Progressed += operation_Progressed;

            AreAnyOperationsOngoing = true;
            operation.Start();
        }
示例#2
0
        private void CleanAfterOperation(OperationBase operation)
        {
            operation.Finished -= operation_Finished;
            if (operation.IsComplexOperation)
                operation.Progressed -= operation_Progressed;

            WpfUtilities.ThreadSafeInvoke(() => Pending.Remove(operation));
            CheckOngoingOperations();
        }
示例#3
0
 public void CancelOperation(OperationBase operation)
 {
     operation.Cancel();
     CleanAfterOperation(operation);
 }
示例#4
0
 public void UndoOperation(OperationBase operation)
 {
     operation.Undo();
     Finished.Remove(operation);
 }