all groups > dotnet windows forms designtime > august 2004 >
You're in the

dotnet windows forms designtime

group:

Custome Form Designer: How to implement undo/redo


Custome Form Designer: How to implement undo/redo Tian Qiang Chen
8/13/2004 4:26:51 PM
dotnet windows forms designtime:
Hi,
I got the sample code "DesignerHost" from "INFO: Code Sample That
Demonstrates How to Create a Custom Form Designer by Using Visual C# .NET"
http://support.microsoft.com/default.aspx?scid=kb;en-us;813808.
The sample code has no these features "copy, cut, paste, undo and redo", I
wanna implement them. After seaching on internet, I got the result" to
implemnt copy, cut, paste, you must implement IDesignerSerializationService
and add this service. I wrote a SampleDesignerSerializationService.cs, the
sample has copy,paste and cut features.

Now I such on implmenting undo/redo feature. In the sample code, the
copy/paste command is added by default when System.Windows.Forms.Form is
created. Using "MenuCommandSerice.GlobalInvoke" can call the copy/past
functions. But the undo and redo standard commands is not added by default.
I want to know which attribute should be added on the form, I can invoke the
undo/redo function.

And I am not sure, whether any other service should be add to the
DesignHost, The the undo/redo feature can works.

Thanks

Tian Qiang

Re: Custome Form Designer: How to implement undo/redo Yap We Kwang
8/25/2004 1:48:58 AM
Hi Tian
Could you show me how to you implement IDesignerSerializationService in you custom class SampleDesignerializationService.cs? I also implemented my own custom IDesignerSerializationService class which has two methods-- that are Serialize and Deserialize. Is that need to add host.createComponent() in Deserialize method and host.Container.Add() in Serialize method? I'm very appreciate your help if you can give me some guide on what thing need to do in this both method. Many thanks


---
AddThis Social Bookmark Button