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(); }
private void CleanAfterOperation(OperationBase operation) { operation.Finished -= operation_Finished; if (operation.IsComplexOperation) operation.Progressed -= operation_Progressed; WpfUtilities.ThreadSafeInvoke(() => Pending.Remove(operation)); CheckOngoingOperations(); }
public void CancelOperation(OperationBase operation) { operation.Cancel(); CleanAfterOperation(operation); }
public void UndoOperation(OperationBase operation) { operation.Undo(); Finished.Remove(operation); }