Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Deleting nodes and links (Read 3344 times)
vtortola
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 104
Joined: Nov 26th, 2008
Deleting nodes and links
Nov 27th, 2008 at 4:43pm
Print Post  
Hi!

Are there a programatically way to delete nodes and links raising the Node_Deleting and Link_Deleting events?

If I do : "diagram1.Items.Remove( diagram1.ActiveItem);" those events are no raised, therefore I can't validate the operation before the elements disappear from the diagram.

Those events are raised when I press "Supr" key, so I need do the same than that key do.

Cheers.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deleting nodes and links
Reply #1 - Nov 27th, 2008 at 6:06pm
Print Post  
Hi!

Nope, validation events are raised only for users actions. You could move your validation code to some helper method invoked both from the event handler and from before Remove is called.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vtortola
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 104
Joined: Nov 26th, 2008
Re: Deleting nodes and links
Reply #2 - Nov 27th, 2008 at 6:20pm
Print Post  
Is posible avoid or override the behavior of the Del key?

Cheers.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Deleting nodes and links
Reply #3 - Nov 28th, 2008 at 2:10pm
Print Post  
You could add your own command binding for ApplicationCommands.Delete to diagram.CommandBindings.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vtortola
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 104
Joined: Nov 26th, 2008
Re: Deleting nodes and links
Reply #4 - Nov 28th, 2008 at 2:31pm
Print Post  
Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint