Serialization / Clone Issue with Nodes dragged from SymbolPalette to Diagram

Hi,

I have been creating a Symbol with the SymbolDesigner and ran ancross some Issue when I use the created Symbol in a SymbolPalette. As soon as I drag the Symbol to a Diagram, some information previously stored in the symbol by hand gets lost. The following objects are null afterwards or contain incomplete information:
- Node.Tag : null
- ConnectionPoint.ConnectionPointType : reset to IncomingOutgoing
- ConnectionPoint.Name : null

I assume dragging some Node from SymbolPalette to a Diagram clones the object and the cloning is restricted to only some but not all properties. I was able to solve these problems by subclassing the ones, that were missing some important information and overriding the Clone method, well for now. But for this I have to deserialize the .edp file, and modify the object tree afterwards, which seems to be hacky to me. Is there another solution?

Regards,

Bernhard


5 Replies

J. J.Nagarajan Syncfusion Team July 8, 2008 09:47 AM UTC

Hi Bernhard ,

Thanks for your interest in Syncfusion products.

This is known issue and this issue has been fixed in our latest source and the fix is available in our latest release(v6.3.0.25). You can download this version from the following page.

http://www.syncfusion.com/downloads/latestversion/default.aspx

Unlock key:

If your Essential Studio license is current,you will be able to obtain the key to install this version from your account in DirectTrac Otherwise, please contact your Syncfusion Sales Representative or e-mail [email protected]

Our latest version of diagram can support to serialize Node.Tag, ConnectionPoint.ConnectionPointType and ConnectionPoint.Name properties.

Please let me know if you have any problem in our latest version.

Regards,
Nagaraj




BJ Bernhard Jahn July 8, 2008 11:40 AM UTC

Great!

All issues have been resolved! Thanks for the quick answer.

>Hi Bernhard ,

Thanks for your interest in Syncfusion products.

This is known issue and this issue has been fixed in our latest source and the fix is available in our latest release(v6.3.0.25). You can download this version from the following page.

http://www.syncfusion.com/downloads/latestversion/default.aspx

Unlock key:

If your Essential Studio license is current,you will be able to obtain the key to install this version from your account in DirectTrac Otherwise, please contact your Syncfusion Sales Representative or e-mail [email protected]

Our latest version of diagram can support to serialize Node.Tag, ConnectionPoint.ConnectionPointType and ConnectionPoint.Name properties.

Please let me know if you have any problem in our latest version.

Regards,
Nagaraj






BJ Bernhard Jahn July 9, 2008 12:12 PM UTC

I think I was too fast on this one. It is still necessary to subclass the used subclass of Node(in my case Group), so that the Tag property gets cloned as well as soon as I drag something from a SymbolPalette to the Diagram. Not that this is causing to any bigger problems for me now, but I still consider it a bit hacky for my taste.



J. J.Nagarajan Syncfusion Team July 10, 2008 10:20 AM UTC

Hi Bernhard ,

You need not again sub class the group node to serialize the tag property in a Symbolpalette. You have to call Clone overridden method in the Group's subclass. Please refer to the attached sample for more details.

http://websamples.syncfusion.com/samples/Diagram.Windows/F75001/main.htm

In this sample when you can drag and drop the group node from the palette. You can get the Tag properties of each child node a group when you select them.

Please refer to it and let me know if this helps.

Regards,
Nagaraj




BJ Bernhard Jahn July 11, 2008 07:54 AM UTC

That's exactly what I've been doing. Subclassing Group(like in the example) and provide a Clone methode(not like in the example) that checks if Group.Tag is ICloneable and then calls Clone on it. Then it puts the cloned Tag object into the cloned Group(which it gets by calling base.Clone() of Group). This is returned to the calling code(something somewhere in the GUI). My suggestion is, to put this kind of functionality into all Clone() methods: a check if Tag is ICloneable, and clone this one, too, prior to returning the cloned Node back.

>Hi Bernhard ,

You need not again sub class the group node to serialize the tag property in a Symbolpalette. You have to call Clone overridden method in the Group's subclass. Please refer to the attached sample for more details.

http://websamples.syncfusion.com/samples/Diagram.Windows/F75001/main.htm

In this sample when you can drag and drop the group node from the palette. You can get the Tag properties of each child node a group when you select them.

Please refer to it and let me know if this helps.

Regards,
Nagaraj





Loader.
Up arrow icon