Copy/paste problem

Hi *,
Trying to implement the copy/paste feature I am facing the following problem:
Even my document class is marked as serializable and my implementation of Go objects as well , EditPaste method of my view does not work (the Ctrl+drag works fine).
I’ve overriden PasteFromClipboard() method of my view trying to get the data from the Clipboard but the .GetData(this.Document.DataFormat) method of the IDataObject returns null (even the .GetDataPresent(this.Document.DataFormat) returns true).
Any ideea ?
Thanks,
c#risti

Hi,
The problem occurs only when I create the instance of my view’s parent form using a.CreateInstance(…) where “a” is a loaded assembly containing my implementation of the view , document and GoObject classes.
I need this kind of activation becasue the implementation is inside a plugin.You could easily replicate this,still waiting for some help … .
Thanks,
c#risti

You might be able to figure out what the problem is by explicitly doing the serialization/deserialization and looking at any exceptions that occur:
Stream ofile = File.Open(“test.graph”, FileMode.Create);
IFormatter oformatter = new BinaryFormatter();
oformatter.Serialize(ofile, myView.Document);
ofile.Close();
Stream ifile = File.Open(“test.graph”, FileMode.Open);
IFormatter iformatter = new BinaryFormatter();
GoDocument doc = iformatter.Deserialize(ifile) as GoDocument;
ifile.Close();
myView.Document = doc;

Hi Walter,
You are right , an error occurs during deserialization , but only if I load the the assembly containing my objects using the activator.
I have a solution with 3 projects : start.exe , start2.exe and TestClip.
TestClip is a library containing a document , a view ,a node implementation (I used simplified versions of GraphNode, GraphView and GraphDoc from the OrgCharter sample ) and a form as parent for the view(TestForm).
1.“start” project uses activator to create the instance of the “TestForm” and the deserialization fails(copy/paste as well).
2.“start2” references the TestClip library and create the “TestForm” for using “new”.In this case everything goes well.
What am I doing wrong here ?(I could send you the small solution I used for tests above if needed).
Thanks,
c#risti

Serialization is required for proper use of the clipboard, since the data may need to cross AppDomains.
I suspect the deserializer is not able to find the needed Types when they are loaded dynamically, but I don’t know how to fix that problem. Maybe you can find the solution in the documentation or on the web, since it doesn’t really involve GoDiagram at all.

Thanks Walter,
however if you have any ideea how to solve this , please post it here.I really need this.
c#risti