AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

ObjectXMLSerializer<(Of <(<'T>)>)> Class

Facade to XML serialization and deserialization of strongly typed objects to/from an XML file. References: XML Serialization at http://samples.gotdotnet.com/: http://samples.gotdotnet.com/QuickStart/howto/default.aspx?url=/quickstart/howto/doc/xmlserialization/rwobjfromxml.aspx

Namespace:  AdvantageCMS.Core.Utils
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public static class ObjectXMLSerializer<T>

Type Parameters

T

Examples


Round-trip serialization to file and back:
C#
// Save an object to an XML file
var config = new AppConfig { Name = "MyApp", Version = 2 };
ObjectXMLSerializer<AppConfig>.Save(config, @"C:\Data\config.xml");

// Load it back
AppConfig loaded = ObjectXMLSerializer<AppConfig>.Load(@"C:\Data\config.xml");

// Round-trip via string
string xml = ObjectXMLSerializer<AppConfig>.SaveToString(config);
AppConfig fromString = ObjectXMLSerializer<AppConfig>.LoadFromString(xml);

Inheritance Hierarchy


Object
  AdvantageCMS.Core.Utils..::..ObjectXMLSerializer<(Of <(<'T>)>)>