The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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