Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re: How load node Onload? (Read 3915 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How load node Onload?
Mar 2nd, 2011 at 10:23am
Print Post  
Hi Pablo,

If you need to add a hosted control:

Code
Select All
var button = new Button();
var node = new DiagramNodeAdapter(diagram, button);
node.Bounds = new Rect(33, 33, 333, 333);
diagram.Nodes.Add(node); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: How load node Onload?
Reply #1 - Mar 2nd, 2011 at 10:25am
Print Post  
Ups, by error, i delete the original post jijij, sorry

One more question:

Exist some way to lock some kind of node for prevent deletion of that specific node.
I want this node can be only moved not resized, but never deleted, even if run diagram.ClearAll();
I no think this is possible but if possible, please tellme, need lock a specific kind of node for not delete.
Bets regards.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How load node Onload?
Reply #2 - Mar 2nd, 2011 at 10:35am
Print Post  
Handle NodeDeleting and set e.Cancel = true.
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: How load node Onload?
Reply #3 - Mar 2nd, 2011 at 12:00pm
Print Post  

private void form_NodeDeleting(object sender, NodeValidationEventArgs e)
     {

        if (e.Node.UIElement is MyCustomNode)
        {
            e.Cancel = true;
        }
            
     }



This work when i try delete node using delete, but when i run form.ClearAll(); is deleted anyway.
Is possible pskip deletion when use ClearALL ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How load node Onload?
Reply #4 - Mar 2nd, 2011 at 12:50pm
Print Post  
You will have to either create the node again, or do something like this:

diagram.Nodes.Remove(theNode);
diagram.ClearAll();
diagram.Nodes.Add(theNode);
  
Back to top
 
IP Logged
 
PDM.
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 256
Joined: Dec 2nd, 2010
Re: How load node Onload?
Reply #5 - Mar 2nd, 2011 at 1:30pm
Print Post  
Ok, thankyou, this work perfect now.
One final question about this.
Using same logic i want prevent object can be copied, using copy and paste, so how can prevent Node cant be copied?

Yhankyou for your faster help.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How load node Onload?
Reply #6 - Mar 2nd, 2011 at 2:39pm
Print Post  
Only by removing it from the selection first, or immediately deleting the copy after calling Paste.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint