WorkItem Persistence

Topics: CAB & Smart Client Software Factory
Feb 16, 2006 at 6:46 AM
originally posted by: CSain

I currently have a simple FormShellApplication that runs 1 WorkItem. The WorkItem allows the user to specify some search criteria, run a query, and populate the results in a datagrid. Currently, the search criteria and DataSet of results are stored in the WorkItem's State.

I want to use persistence to save the WorkItem when the application closes, and when the application starts up again, display the last WorkItem to the user. They should be able to see the search criteria and search results from the previous run.

Any suggestions on how to implement this with CAB? I started looking at the persistence service and noticed that it requires a WorkItem ID. I don't currently remember the ID of the last WorkItem (if any) when the application starts up.
Feb 16, 2006 at 6:53 AM
originally posted by: ChrisHolmes

Don't worry, the WorkItem remembers it for you :)

workItem.ID will contain the ID of the WorkItem. You can use that in conjunction with the Persistance Service to save the state of your WorkItem.
Feb 16, 2006 at 9:46 AM
originally posted by: CSain

I guess my question is more about persisting the state of the application when it closes. For instance, I may have several open work items in process when the app closes that I want to reinstate the next time the app starts up.
Feb 17, 2006 at 7:49 AM
originally posted by: BradWilsonMSFT

There is some rudimentary support for persisting the things in the State bag, but that's not sufficient for what you want I suspect.