I’m trying to create a node that contains (multiple) shapes and a variable number of ports. I choose to extend GoNode.
I’m running into some trouble when copying nodes. I 've created a small test node to illustrate the problem.
class ModuleNode : GoNode
private GoRectangle rect;
rect = new GoRectangle();
rect.Selectable = false;
Size = new SizeF(50, 100);
I’m not able to do copy paste on a this node in a GoView. The strange thing is, drag and drop from a GoPalette on a GoView works like a charm. This just creates a copy, right?
I’ve searched this forum on related problems and I suppose a need to override the CopyObject and/or CopyChildren methods. I haven’t found anything regarding copying nodes in the documentation.
So to the point, why doesn’t the copying work? What do I need to do to make it work? Is there any documentation available regarding the copying of nodes and updating references?
Any help is very much appreciated.
Edit: adding [Serializable] to the class definition helps a lot … ;)
However I’m still looking for information regarding copying of nodes and specifically members that hold references.