public void Begin(CancellableOperation operation, DataDriveViewModel drive = null) { try { Debug.Assert(!Busy); operation.Finished += HandleOperationFinished; operationInProgress = operation; operation.Begin(vm, drive); } catch (Exception e) { App.LogCrash(e); LogFile.Log("Exception trying to begin {0}: {1} ", operation.Name, e.Message); } }
private void HandleOperationFinished() { operationInProgress.Finished -= HandleOperationFinished; OperationFinished(operationInProgress, new EventArgs()); operationInProgress = null; }