I’m overriding the CopyObject() and CopyObjectDelayed() methods of a sub-class of GoLink. CopyObject() just returns base.CopyObject(). In CopyObjectDelayed(), I’m trying to update a property of the business object in the FromNode with a property contained in the business object of the ToNode.
The link object may come "From" three different types of shape objects that are sub-classes of CollapsingRecordNode, CollapsingRecordNodeItem or CollapsingRecordNodeList. When the link comes from either of the first two, the copy remains attached to the copy of the link. Each of these sub-classes contain business objects which are cloned in the CollapsingRecordNode's override of CopyObject().
However, when it comes from the third, the copy of the link gets detached from the copy of the node.
I notice that CopyObject() and CopyObjectDelayed() get fired twice in the copy/paste cycle. During the GoView.EditCopy() method, the FromNode property points to the copy of the CollapsingRecordNodeList. But during the GoView.EditPaste(), the FromNode property is null.
Is there a way I can find the original link class in the GoCopyDictionary which I'd use to find the original CollapsingRecordNodeList, which, hopefully will point to its copy?
It sounds like you don’t really need the override of CopyObject, but you have it anyway so that you can try to understand what’s going on.
In your override of CopyObjectDelayed, are you first calling the base method? You should.
The reason copying happens twice is because there's a copy from the view's document to the clipboard's document, and then there's a copy from the clipboard's document to the destination view's document.
As long as you called the base method first, I don't understand how the FromNode property could be null and yet the paste finishes correctly.
Thanks for the fast reply.
Ever figure out the problem right after asking a question? I didn't figure out the entire problem, I did figure out why I lost the FromNode.