Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Operation cancelled events + container events (Read 2489 times)
Jan Lyson
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Dec 4th, 2019
Operation cancelled events + container events
Dec 11th, 2019 at 12:40pm
Print Post  
Hello,
I would like to ask if there is any way to get informed about cancelled operation such as link creating or link modifying. For example I do some preparations in LinkCreating event handler and I want to dispose those prepared things when it is cancelled.

My second question is about an order of events. When I move a node from container I get events in this order
1.Node removed from container
2.Node moved

but when I do a reverse operation I get
1.Node moved
2.Node added to container

I need to know about adding into container before node moved event is raised. Is it possible to achieve it somehow?

Thanks
Jan
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Operation cancelled events + container events
Reply #1 - Dec 12th, 2019 at 7:58am
Print Post  
Hi,

Quote:
I would like to ask if there is any way to get informed about cancelled operation such as link creating or link modifying. For example I do some preparations in LinkCreating event handler and I want to dispose those prepared things when it is cancelled.


Here our developer ported some *Cancelled events we have in diagram's Windows Forms version to WPF -

https://mindfusion.eu/_beta/wpfdiag_cancel.zip

(NodeCreateCancelled, NodeModifyCancelled, LinkCreateCancelled, LinkModifyCancelled)

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Operation cancelled events + container events
Reply #2 - Dec 12th, 2019 at 8:12am
Print Post  
Quote:
I need to know about adding into container before node moved event is raised. Is it possible to achieve it somehow?


Try this -

Code
Select All
void OnNodeModified(object sender, NodeEventArgs e)
{
    var nodes = diagram.GetNodesAt(e.MousePosition);
    foreach (var node in nodes)
    {
        if (node == e.Node)
            continue;
        var container = node as ContainerNode;
        if (container != null && ContainerNode.GetContainer(e.Node) != container)
            Debug.WriteLine("will add to container");
    }
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Jan Lyson
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Dec 4th, 2019
Re: Operation cancelled events + container events
Reply #3 - Dec 12th, 2019 at 12:50pm
Print Post  
Hi,
thanks, will it be in official NuGet package someday? Or is it possible to get a NuGet package with this version of DLLs now?

Jan


  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Operation cancelled events + container events
Reply #4 - Dec 12th, 2019 at 1:29pm
Print Post  
Hi,

We'll try to release a new version in January along with some other new features.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Jan Lyson
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Dec 4th, 2019
Re: Operation cancelled events + container events
Reply #5 - Dec 12th, 2019 at 1:51pm
Print Post  
Slavcho wrote on Dec 12th, 2019 at 1:29pm:
Hi,

We'll try to release a new version in January along with some other new features.

Regards,
Slavcho


Great. Thanks.
Btw I have a problem with dlls you provided. When I want to attach to cancelled events I get following exception.

Inner Exception 1:
MissingMethodException: Method not found: 'Void MindFusion.Diagramming.Wpf.DiagramBase.add_LinkCreateCancelled(System.EventHandl
er`1<MindFusion.Diagramming.Wpf.LinkEventArgs>)'.

Jan

  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Operation cancelled events + container events
Reply #6 - Dec 12th, 2019 at 2:14pm
Print Post  
Sounds like compiling against new set of assemblies but then loading old ones at runtime.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Jan Lyson
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 26
Joined: Dec 4th, 2019
Re: Operation cancelled events + container events
Reply #7 - Dec 12th, 2019 at 2:30pm
Print Post  
Ops, you were right, my bad. It works now.
Thank you very much.

Jan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint