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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Checking if a serialization file is valid

Thread ID:

Created:

Updated:

Platform:

Replies:

23986 Jan 26,2005 01:27 PM UTC Jan 31,2005 02:23 PM UTC WinForms 1
loading
Tags: Diagram
Jose Santos
Asked On January 26, 2005 01:27 PM UTC

Hi, I''ve been some files generated with SaveSoap from diagram. As I change some of the classes members, the serialization writes them in a different way and they became incompatible. My question is how to detect they are incompatible efficiently. I''m doing this: private bool IsValidProject(string fileName){ try{ new Diagram().LoadSoap(fileName); }catch{return false;} return true; } which is bad... (since if it''s valid I''m loading it to the right variable). By the way, I put it on the right variable and it''s invalid the interface gets fuzzy (because LoadSoap put the variables with invalid values). Regards, Jose Santos

Administrator [Syncfusion]
Replied On January 31, 2005 02:23 PM UTC

Hi Jose, You could try providing a variant of the Diagram.LoadSoap(string fileName)/Diagram.LoadSoap(Stream streamin) methods so that the Diagram control''s attributes(the Diagram.Model, Diagram.View and Diagram.DiagramScript objects) are re-initialized only when you want them to. Adding a helper method that deserializes the provided soap stream, but returns without re-initializing the current instance of the diagram with the deserialized mode/view/diagramscript objects will let you test the validity of the serialized file. Please refer to the Diagram.LoadSoap(Stream streamin) method in the ''..\Diagram.Windows\Src\Controls\Diagram.cs'' file for details on the deserializing process. Thanks, Prakash

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;