Solved

Redo/Undo in Vb.net

Posted on 2006-07-13
4
1,477 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now