Serialization Support in Diagram Windows Forms | Syncfusion Blogs
Detailed Blog page Skeleton loader

Essential Diagram for Windows Forms provides extensible support for serialization, which is the process of reading and writing a collection of objects to and from an I/O stream. Essential Diagram uses the .NET serialization framework provided by the System.Runtime.Serialization namespace.

Serialization and de-serialization can be easily performed on diagram (.edd) files and symbol palette (.edp) files.

The Diagram class contains methods for loading and saving files in two of the formats that are supported by the .NET serialization framework.

Binary Format

The LoadBinary and SaveBinary methods serialize diagrams symbol palettes to files and I/O streams in a binary format.

SOAP Format

The LoadSOAP and SaveSOAP methods use the SOAP XML format to serialize diagrams and symbol palettes to files and I/O streams.

 

c#

            case "SaveBinary":
                 this.diagram1.SaveBinary(path + @"\Test.edd");
                 break;

             case "LoadBinary":
                 if(File.Exists(path + @"\Test.edd"))
                 this.diagram1.LoadBinary(path + @"\Test.edd");
                 break;

             case "SaveSoap":
                 this.diagram1.SaveSoap(path + @"\Test.xml");
                 break;

             case "LoadSoap":
                 if (File.Exists(path + @"\Test.xml"))
                 this.diagram1.LoadSoap(path + @"\Test.xml");
                 break; 

image

Diagram Serialized to SOAP Format

Be the first to get updates

Syncfusion Guest Blogger

Meet the Author

Syncfusion Guest Blogger