SonyWWS / ATF

Authoring Tools Framework (ATF) is a set of C#/.NET components for making tools on Windows. ATF has been in continuous development in Sony Computer Entertainment's (SCE) Worldwide Studios central tools group since early 2005. ATF has been used by most SCE first party studios to make many custom tools such as Naughty Dog’s level editor and shader editor for The Last of Us, Guerrilla Games’ sequence editor for Killzone games (including the Killzone: Shadow Fall PS4 launch title), an animation blending tool at Santa Monica Studio, a level editor at Bend Studio, a visual state machine editor for Quantic Dream, sound editing tools, and many others.
Apache License 2.0
1.89k stars 262 forks source link

allow insertitemfunc delegates to return null; cancel transactions if so #56

Closed jethac closed 8 years ago

jethac commented 8 years ago

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.

abeckus commented 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.

jethac commented 8 years ago

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!