Nevron Forum

Copy/Paste

https://www.nevron.com/Forum/Topic3836.aspx

By Ron Sawyer - Monday, July 19, 2010

Hello, I just purchased Nevron Diagram for .NET. I am trying to create a simple diagram builder.

My apologies, I'm sure this is very simple, but how do I copy and paste the selected objects?
By Nevron Support - Monday, July 19, 2010

Hi,

Here’s a simple example on how to perform copy and paste operations:

 

NRectangleShape rect = new NRectangleShape(20, 20, 100, 60);

document.ActiveLayer.AddChild(rect);

 

NNodeList nodes = new NNodeList();

nodes.Add(rect);

 

view.Copy(nodes);

view.Paste();

 

 

If you want to copy/paste only the selected nodes, you can use the following code:

 

view.Copy(view.Selection.Nodes);

view.Paste();

 

By Ron Sawyer - Monday, July 19, 2010

Thanks for the quick reply. The question seems rather lame now...

I would swear I looked at the view's methods - but I guess I must have been looking at the document's methods instead.

By Fabian Baptista 1 - Monday, October 4, 2010

And how can I do this from one view to another?
regards.
By Nevron Support - Tuesday, October 5, 2010

Hi Fabian,

upon copying/pasting the clipboard is used, so you can copy from one view and paste in another in the same way. Call the "Copy" method of the first view and then the "Paste" method of the second.