Is there a way to store all the window form events inside a list, so all of those events can be reapplied when the user opens the form next time?
Example: Let’s say the user clicks a button inside a form and types in a string and then closes the form. After a while the user reopens the application again, and the form is re-initialized so that the click action and the string the user input is restored. (Kind of like an auto-save function.)
Purpose for this:
- Recover after suspension.
- Allow user to undo their work (Undo Button).
I am still not sure I understand you, but you say you want to get a list of events, okay, that can be done using Reflection. Here is a good link: http://www.switchonthecode.com/tutorials/csharp-tutorial-using-reflection-to-get-object-information
Your example:
-You can do this without getting a list of events. So I don’t see why you have to do it this way. There are multiple ways to do this. If you are using a winform, one basic solution is to define properties using the settings page. Check this out:
http://msdn.microsoft.com/en-us/library/cftf714c(VS.90).aspx
Use the Settings page of the Project Designer to specify a project’s application settings. Application settings enable you to store and retrieve property settings and other information for your application dynamically. They also enable you to maintain custom application and user preferences on a client computer. For more information, see Application Settings.
You can establish waypoints (to borrow a term from aviation) and save values to your settings collection periodically without the user having to do anything, like they would have to do if you provided a save button. But that just brings up the point, what’s wrong will the lowly save button. It’s a well known convention. People know that if they don’t want to lose data, they should save every now and then.