CopyObject and selection

I have a custom node that inherit from GoTextNode. since it has refereces and custom event in it I override CopyObject method and in it I created a new object and set it up as required.
I have a custom view that has a context menu with paste command. Inside that function it does EditPaste and tries to MoveSelection to where the mouse was last located (it’s the same sample code from one of your examples). This works fine on the basic nodes, but if I tries to paste the custom node it always paste it at the top left corner (location 0,0).
debugging into it I found that once I’m overriding CopyObject, the newly created node is not being added to the selection of the view. How can I fix it?

walter, what do you think?

walter, good to see that you’re back.
can you answer the above question?

Sorry about that; I’ve probably missed a bunch of messages.
CopyObject is just responsible for copying the state of a GoObject; it has nothing to do with any GoView, including any Selection.
Regarding the positioning of objects from the context menu, there are a number of sample applications that include a context menu Edit Paste command, that causes the pasted objects to be placed at the point of the context menu. You might want to compare your implementation with that sample code.

here the code : public override GoObject CopyObject(GoCopyDictionary env)
ProcessorNode proc = new ProcessorNode();
proc.Name = Name;
return proc;
} If I comment out the creation of the new object and use :
ProcessorNode proc = (ProcessorNode)base.CopyObject(env); I get it to paste it in the right place, meaning my pasting method is ok. any idea?

You need to call the base method and return what it returns, as the documentation states and all of the examples demonstrate.

Exactly my question, why?
what special stuff the base class does, cause other then the pasting problem everything is working fine with creating new object and not calling the base.
The reason for not calling the base is that it’s a MultiTextNode that holds some custon objects. when I use the base class copyObject method, the new object is messed up. All the objects apears in the upper left corner of the newlt created node.

What the base CopyObject method does depends on the class. In particular, GoGroup.CopyObject calls CopyChildren, which makes sure that copies of all the child GoObjects are added to the copied group.
GoObjects showing up at (0,0) are probably because they were newly created but their properties (such as Bounds) were not copied.
Why should you have problems with copying “custom objects”? You just need to decide if your objects (which I assume inherit from Object, not GoObject) should be shared or not. If so, and if the references are in fields, then you don’t need to do anything. If not, you need to make a copy of those custom objects and make sure the new GoObject refers to the copy, or do whatever is needed to make sure the copied GoObject meets your semantic requirements.
(As another example of the latter case, it’s common to have fields that hold cached information that can be recomputed. Those fields you would just set to null in the copy, and let your code reconstruct those objects when needed later.)