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
Yap We Kwang - 25 Aug 2004 09:48 GMT
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
---