You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that UndoBatch is designed similarly to TransactionScope, but TransactionScope requires a "ts.Complete()" call to commit, otherwise the change is rolled back. In the current UndoBatch, there's no ability to rollback. Conforming to the TransactionScope pattern, or at least providing some kind of .Rollback() would be very useful.
I worked around it with
bool success = true;
using (new UndoBatch(...)) {
...
}
if (!success) {
var root = UndoService.Current[undoroot];
root.Undo();
}
The text was updated successfully, but these errors were encountered:
I need to think about this one a bit. For now, I've removed the note in the docs that compares the UndoBatch to TransactionScope.
If we do want to support the "Complete()" type behavior, I think we'll need to add a new "UndoScope" class for that. Changing the UndoBatch's behavior would be a breaking change for those using the library today.
The documentation says that UndoBatch is designed similarly to TransactionScope, but TransactionScope requires a "ts.Complete()" call to commit, otherwise the change is rolled back. In the current UndoBatch, there's no ability to rollback. Conforming to the TransactionScope pattern, or at least providing some kind of .Rollback() would be very useful.
I worked around it with
The text was updated successfully, but these errors were encountered: