Proper way to cancel workitem termination

Topics: CAB & Smart Client Software Factory
Mar 30, 2006 at 12:42 AM
originally posted by: esmilis

I have an application, with some deck workspaces, and some smart parts in them. Smart parts are responsible for managing some business logic objects. The problem is that when i make some changes to a business object, and want to close current smart part, application should ask me to what to do (save, not to save the business object or cancel closing.

I'm wondering what is the proper technique to do this kind of thing.

I tried OnTerminating, but it cannot be canceled.

Any ideas and pratices?
Mar 30, 2006 at 5:05 AM
originally posted by: DLorenz

The way we did this is by creating a base class that inherits from WorkItem. Then we added a MustOverride function called Close to the workitem. In there, you can do whatever logic you need to make sure the user is doing what they want. Then you can call Terminate() or whatever else you need to do instead based on the response.