We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Implementation of Undo

Thread ID:





37128 Nov 16,2005 05:42 AM Nov 17,2005 09:59 AM Windows Forms 1
Tags: Diagram
Administrator [Syncfusion]
Asked On November 16, 2005 05:42 AM

Hi, I have a windows Forms application that uses Syncfusion. On doing a Insert of a Symbol into the diagram, I do create the symbol in the Diagram area using the Syncfusion API as well as set some properties globally for the Symbol plus insert some related data into the database. I have to implement Copy, Paste and Undo in this application. For example, When I am selecting the symbol from the diagram and pasting it in the diagram area again, it should do the following a. It should create the Symbol in the Diagram area in the pasted position b. It should set the properties globally c. It should write into the database Similarly when I do an Undo, it should the do the following a. It should undo the drawing of Symbol in the diagram area b. It should remove the properties for that symbol that was set globally c. It should remove the entry for the relevant symbol from the database Can you let me know how these could be done ? Rgds, Andy

Administrator [Syncfusion]
Replied On November 17, 2005 09:59 AM

Hello Andy, Essential Diagram has built-in support for Undo/Redo and copy/paste operations. Copy/paste can be implemented by responding to the appropriate keyboard events and summoning the Diagram.Controller.Cut/Copy/Paste methods. Please refer to the ''barItemEditCut_Click'', ''barItemEditCopy_Click'' and ''barItemEditPaste_Click'' methods in the MainForm.cs file of the InDepth\DiagramBuilder sample to view the diagram clipboard copy/paste API. In the case of a copy the new node will be a clone of the original node and will thus contain all properties of the original. As for undo/redo of the copied nodes, this is automatically supported when using the diagram controller''s cut/copy/paste methods as shown in the sample. For your database I/O, the best way to get notifications of node insertion/removal is by handling the Diagram.ChildrenChanging and ChildrenChangeComplete events. These events will be raised in response to cut/paste operations, and examining the event arguments will let you determine the involved node(s) and the ensuing operation. I hope this helps. Please let us know if you require further assistance on this issue. Regards, Prakash Surendra Syncfusion Inc.,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.