The MindFusion Forums
https://mindfusion.eu/Forum/YaBB.pl
Flow Diagramming Components >> ASP.NET >> How do I load xml into ContainerNode??
https://mindfusion.eu/Forum/YaBB.pl?num=1489723046

Message started by JH.Chen on Mar 17th, 2017 at 4:57am

Title: How do I load xml into ContainerNode??
Post by JH.Chen on Mar 17th, 2017 at 4:57am
I created a new diagram,and load xml into this diagram.

Then I add items from new diagram into my mainDiagram one by one.

But if new diagram has group, and node in mainDiagram, the MasterGroup will be gone(null).

It will be ungroup.

So how can I do ????????
Please tall me~~

Title: Re: How do I load xml into ContainerNode??
Post by Slavcho on Mar 17th, 2017 at 7:39am
If you are calling node's copy constructor and adding the copy to main diagram, that won't automatically copy group object and child nodes. You could copy the child nodes separately in a loop and attach them again to master copy. If doing that on server side, you could select all items from the group and call CopySelection and PasteSelection methods with copyGroups argument set to true.

Title: Re: How do I load xml into ContainerNode??
Post by JH.Chen on Mar 17th, 2017 at 11:26am
Thanks you,Slavcho.

I'll try this way.

If it works, I'll tall you. :)


Title: Re: How do I load xml into ContainerNode??
Post by JH.Chen on Mar 22nd, 2017 at 1:50am

Slavcho wrote on Mar 17th, 2017 at 7:39am:
If you are calling node's copy constructor and adding the copy to main diagram, that won't automatically copy group object and child nodes. You could copy the child nodes separately in a loop and attach them again to master copy. If doing that on server side, you could select all items from the group and call CopySelection and PasteSelection methods with copyGroups argument set to true.


Hi,Slavcho.
Do this way can copy customize object (nodes,links etc.) ??

Title: Re: How do I load xml into ContainerNode??
Post by Slavcho on Mar 22nd, 2017 at 7:33am
Do you mean copying your own properties for custom item classes? Diagram.CopySelection calls items' Clone method, and default Clone implementation calls copy constructor of the class. So for custom properties support you must either add a copy constructor or override Clone method in the derived class.

Regards,
Slavcho

Title: Re: How do I load xml into ContainerNode??
Post by JH.Chen on Mar 22nd, 2017 at 7:38am
Thank you,Slavcho.

I got it.

The MindFusion Forums » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.