Saving of custom property values in .edd files.

Hi,
I am using Syncfusion 7.2.0.20 Essential Diagram component. My requirement is to create a digram with my custom created symbol with custom properties that can be modified at runtime, save it to a ".edd" file (if possible) and retrieve it again. I am referring to the "Diagram Builder" sample.

To the "Diagram Builder" source code, I have added one extra Symbol palette with my custom created symbol where I have created a custom property. When I drag & drop the custom symbol onto the digram and select it, the property editor shows the custom property as per the requirement.

But the custom property value is not same as the modified value
when the custom property value is modified from the property editor, the digram saved to a ".edd" file and the diagram window closed and reopened.

Is there anyway to save the value of the custom property along with the ".edd" file and retrieve it later on?

I am attaching the source code for your reference.

Regards,
Santanu.




DiagramBulider_CustomSymbol_CustomProperties_7473450c.rar

1 Reply

DM Dinesh M Syncfusion Team July 23, 2009 09:04 AM UTC

Hi Santanu,

In your sample i found that you haven't added the following code for serializing and deserializing the MyCustomProperty.

In MySymbol.cs file.

protected MySymbol(SerializationInfo info, StreamingContext context) : base(info, context)
{
this.myVar = info.GetInt32("strMyCustomProperty");
}

protected override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("strMyCustomProperty", this.myVar);
}

The modified sample can be downloaded from the following location.

http://files.syncfusion.com/support/Diagram.Windows/Forums/DiagramBulider_CustomSymbol_CustomProperties.zip

Regards,
Dinesh


Loader.
Up arrow icon