I’ve been dealing with Copy and Paste issues in my application and running into issues that I’ve not dealt with before. I’m trying to identify solutions but I’m not sure that what I’m doing is the best approach, so I’m asking for any suggestions you might have to better deal with these
My GoObjects need to persist data that is not serializable. Since copy/paste is an important part of my app, I’ve designed my own copy/paste implementation based around a GoSelection that is not tied to my GoView. This GoSelection is a copy of the real GoView.Selection, but created in such a way that I can be assured that my nonserializable data will be persisted in my GoObjects correctly.
During the paste operation, I’d like to insert my GoSelection into the GoView.Document in place of the real GoView.Selection. Since my GoSelection is not tied to the GoView, how do I compute the correct locations (top left corner) for the objects in my selection? Also, is there a way to insert my GoSelection into the GoView.Document without making another copy of the objects - Calling GoView.Document.CopyFromCollection calls the CopyObject method on every GoObject to make another copy.
Any suggestions you can offer would be greatly appreciated.