Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Copy and Paste Node (Read 952 times)
psystems
YaBB Newbies
*
Offline



Posts: 2
Joined: Mar 25th, 2009
Copy and Paste Node
Mar 26th, 2009 at 6:59pm
Print Post  
Hello,
I need to copy & paste a Node & its attached nodes from one connection point to another within the same diagram.

Is there a way to do this?

I have been working with copyselection / pasteselection but it's not working.

Below is the code being used.

Thank you.

Private Sub doc_SelectionMoving(ByVal sender As Object, ByVal e As MindFusion.Diagramming.ValidationEventArgs) Handles doc.SelectionMoving
       DoDragDropSelection()
    End Sub

    Private Sub DoDragDropSelection()
       Dim copy As SelectionCopy
       Dim composite As CompositeCmd
       composite = New CompositeCmd(doc, "Change selection")

       copy = doc.CopySelection(doc, False, False)
       doc.PasteSelection(doc, copy, composite, 0, 0)
       DoDragDrop(doc.SaveToString(), DragDropEffects.Copy)
    End Sub
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Copy and Paste Node
Reply #1 - Mar 27th, 2009 at 7:58am
Print Post  
If you don't need drag-and-drop between different diagram views, the best place to implement that should be the StartDraw method of a custom BehaviorBase-derived class. There you could PasteSelection(CopySelection(...), ...) and return New InteractionState(diagram.Selection, 8, Action.Modify). Assign an instance of your class to DiagramView.CustomBehavior.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint