We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Serialization problem with fonts

I have a problem serializing an object that has a few properties wich of one is of type System.Drawing.Font.
The problem is the following:

In certain points of my application, i serialize the object using the AppStateSerializer like this:

AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFile, "MyFolder\\Preferences");
aser.SerializeObject("MyPreferences", myObjectIstance);
aser.PersistNow();

When I want restore the serialized information, I use the AppStateSerializer too:

MyObject myObjectIstance = new MyObject();
AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFile, "MyFolder\\Preferences");
myObjectIstance = aser.DeserializeObject(("MyPreferences") as MyObject;

the problem is that myObjectIstance is always null!!

I have tryed to comment the property with type System.Drawing.Font and all works correctly!!

Is this a bug? Am I mistaking something?

Regards, Sandro

9 Replies

SA Sandro January 8, 2007 02:42 PM UTC

The problem is not clear? Have I to explain the problem better?

Regards, Sandro


MU Murugan Syncfusion Team January 23, 2007 11:33 PM UTC

Hi Sandro,

We are really sorry for the delay in responding. We have tested the mentioned issue. We could not reproduce the issue here. Could you please provide us a sample having the issue? This will help us to resolve the issue soon.

Thanks for choosing Syncfusion products.

Regards,
Murugan P.S


SA Sandro January 24, 2007 10:18 AM UTC

I have created a little sample that reproduce the error.

If you run the application attached, in the form that appears choose a font with the font dialog. Then click "serialize it" and next "Load from serialized". You can see that the first class (including a property with type System.Drawing.Font) will be null and the second class (the same as the first but without the property with type System.Drawing.Font) will be correctly loaded.

I wish this example will be clear.

Best regards, Sandro

SerializingFontSample.zip


MU Murugan Syncfusion Team January 31, 2007 11:29 PM UTC

Hi Sandro,

Thanks for your sample.

We have tested the issue using v4.4. We could not reproduce the issue here. Could you please send us your Essential Studio version details. It will be very useful to analyse the issue further.

Herewith I have attachd the video file that shows my testing process. Please have a look at this and let me know if i missed anything.

SerializedObject

Thanks,
Murugan P.S


SA Sandro February 6, 2007 11:10 AM UTC

I have tested the sample application on the machines of my collegues, and I saw that the application works on machine with English operative system and not on Italian operative systems.
This is a problem because my application will be distribuited worldwide, and now I don't know if works on all operative systems.

Can you tell me if there is a way to resolve this problem?

Regards, Sandro


SA Sandro February 19, 2007 08:53 AM UTC

Dear Murugan,

since I'm not receiving any feedback to my support request, I assume that this problem is caused by a bug in your component.
Do you have any plan to release a bug-fix for it?
I'm waiting for an answer as soon as possible.

Best Regards, Sandro.


MU Murugan Syncfusion Team February 20, 2007 12:00 AM UTC

Hi Sandro,

We are really sorry for the delay in responding. We are looking into the issue. We will update the details on Wednesday.

Thank you for your patience.

Regards,
Murugan P.S


SA Sandro March 7, 2007 08:41 AM UTC

Today = Wednesday + 14 ...

BS, Sandro


VM Venugopal M Syncfusion Team March 26, 2007 12:09 PM UTC

Hi Sandro,

We are very regret for the delay in response. We are able to see the issue and forwarded to development team. But you can resolve this problem using BinaryFile format instead of XMLFile until issue getting fixed. In the attached sample I have persist the object state in binary file and de-serialized. Its working fine in Italian operative system also.

For Instance:

AppStateSerializer aser1 = new AppStateSerializer(SerializeMode.BinaryFile, "PreferencesWithFont");

(Instead of)

AppStateSerializer aser1 = new AppStateSerializer(SerializeMode.XMLFile, "PreferencesWithFont");

You can get sample from here :
http://websamples.syncfusion.com/samples/Tools.Windows/FontSerializing/main.htm

Could you please open a direct-trac incident with subject line as forum id to proceed with this bug.

Thank you for interest in Syncfusion Product.

Thanks ,
Venugopal M.

Loader.
Live Chat Icon For mobile
Up arrow icon