Hi, I wanna know how can I identify the object I copied when I paste.
I have a database and I need to copy the record of the object I copied, I identify the record by the partId. So I need to know the ols partId and the new one. is it possible?
In CopyObject, the object returned from base.CopyObject is the “new copy” and the “this” is the object being copied. (See samples in Flowgrammer, OrgCharter, Processor.)
for example, here is the code from GraphNode.cs in OrgCharter…
public override GoObject CopyObject(GoCopyDictionary env) { GraphNode newobj = (GraphNode)base.CopyObject(env); if (newobj != null) { newobj.UserObject = new GraphNodeInfo(newobj); } return newobj; }
I just have a problem with the undo.
I copied and pasted an object. When I undo, on the “documentChanged” “case GoLayer.RemovedObject:” the partID is -1.
How can I know the real partID?
Yes.
The problem is that the partID is asigned after inserted. When I delete an obejct I have the partID on GoLayer.RemovedObject, but I dont have the partID when I do undo after paste (it execute the GoLayer.RemovedObject)