Closed jethac closed 8 years ago
You can accomplish same thing without changing ATF. Instead of returning null from InsertItemFunc just throw InvalidTransactionException and it will cause the transaction to terminate.
Thanks Alan! I don't know why I didn't think of that; the delegates are of course only called in this context and it makes sense to throw an InvalidTransactionException down at that level. I'll close this - thanks for your advice!
I found myself in a situation where I needed to be able to disallow inserting items using EmbeddedCollectionEditor; I handled this by allowing InsertItemFunc delegates to return null, throwing an InvalidTransactionException to cancel transactions when they do.