Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Thrown exception does not trigger Undo in an action
 

Thrown exception does not trigger Undo in an action

I am throwing an exception from the Execute method of the Action but the Undo method is not being called. I simply display a message in the undo for now but cannot figure out how to get into that part of the code. My assumption is that the host is managing the exceptions and calling the undo method in response.

FredH  Monday, May 21, 2007 11:35 PM
That's correct. GAX keeps an internal list of executed actions, and if one of them throws then this list is iterated and the .Undo method on each saved action is called.

-Victor.
vga  Wednesday, May 23, 2007 6:15 AM
Never mind... I misunderstood the mechanics a little and now realize that the undo will be called on all previous actions.
FredH  Tuesday, May 22, 2007 3:51 AM
That's correct. GAX keeps an internal list of executed actions, and if one of them throws then this list is iterated and the .Undo method on each saved action is called.

-Victor.
vga  Wednesday, May 23, 2007 6:15 AM

You can use google to search for other answers

Custom Search

More Threads

• June '06 Smart Client factory guidance throwing exception
• System.Web.Extensions
• Couldn't find assembly "Microsoft.Practices.RecipeFramework.VisualStudio"
• HOL006 problem - Exercise 2
• How to add a single file in a <ProjectCollection>..</ProjectCollection>.
• declaring unrequired arguments in custom wizard
• Use T4 when unfolding solution
• Code Snippets not uninstalling
• Service Factory ( Data Access ) - Handling with transactions
• Specifying file creation paths