Solved

Redo/Undo in Vb.net

Posted on 2006-07-13
4
1,484 Views
Last Modified: 2008-01-09
Redo/Undo ( in .Net)

How to do redo/undo for add,delete operations in vb.net using msaccess as backend?

Any links or tips?
0
Comment
Question by:biplavo
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
JRossi1 earned 70 total points
ID: 17102419
That is a very complex feature.  Consider this:

Maintaining state of Business Object and User Interface to provide N-No of Undo/Redo capability. User Interface and Business Object synchronization (After any Undo/Redo operation, the UI should focus the Bound control whose value is changed).

"As far as maintaining the state of the business object is concerned, this problem is resolved. But the only trouble i am facing is "The User Interface must respond and set the focus to the underlying control"

Problem Description:

The undo/redo action should allow user-initiated changes to be reversed and re-applied. It is necessary to detect user-initiated changes to the business object. It would be insufficient to monitor the various property change events emitted by the business object because the event
handler would be unable to tell whether the change originated from the UI. Furthermore, it would be insufficient to monitor the validated event because this event provides no details about the binding activity (before/after property values). Also some modifactions to the state of the object might result from a method invocation.

The requirement is to find an event which gets fired every time the Object property is changed or reset. As well as this event should notify us the current bindingContext. The binding class in .Net Framework provides us 2 such events viz Format and Parse and these two events proved to be insufficient because of their nature of occurance. (The Format event gets fired every time before and after the object properties are changed and there is no notification of New and Old values. The Parse event gets fired every time when the property is changed through the UI and will not get fired when the property is changed through the code)

Research over BindingManagerBase revealed that the Push /Pull data methods are not virtual methods, they are only protected methods in BindingManagerBase, so it seems deriving from BindingManagerBase could not customize them, also the BindingContext only accepts the class which base is BindingManagerBase so create a wrapper class for the PropertyManager class also might not work

In order to achieve the above mentioned objective, we are thinking of building a CommandManager which would sit between the Presentation layer and Business layer. CommandManager will be responsible for interacting with the Business layer and maintaing the UI state as well as the Business Object's current state. Any property changes/method calls to the Business Object will pass through the CommandManager. This solution requires the team developers to write their own Custom binding over the .Net Framework and seems to be a possible but too much of an effort.
0
 

Author Comment

by:biplavo
ID: 17107389
So Mr. JRossi1, do i have any choice or not?
Does VB.Net provides any feature in "Dataset" for this particular case?

0
 
LVL 6

Expert Comment

by:JRossi1
ID: 17107507
No. You do not have a choice.  The VB.NET provides no such feature.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question