Class XMLSerializer
Holds methods for XML serialization
Inheritance
Namespace: PnP.Framework.Utilities
Assembly: PnP.Framework.dll
Syntax
public static class XMLSerializer : object
Methods
Deserialize<T>(String)
Deserializes an XML string to an object instance
Declaration
public static T Deserialize<T>(string xmlString)
where T : new()
Parameters
System. A string in XML format that representing the serialized object |
Returns
T
An object instance of T |
Type Parameters
T
The Object Type to Desserialize |
Deserialize<T>(XDocument)
Deserialize an XDocuemnt to instance of an object T
Declaration
public static T Deserialize<T>(XDocument xdoc)
Parameters
XDocument
xdoc
XML document |
Returns
T
Returns deserialized object |
Type Parameters
T
Generic Type paramerter |
Serialize<T>(T)
Serializes an object instance to an XML represented string.
Declaration
public static string Serialize<T>(T objectToSerialize)
where T : new()
Parameters
T
objectToSerialize
Object to serialize |
Returns
System. An string that represents the serialized object. |
Type Parameters
T
Generic Type parameter |
Serialize<T>(T, XmlSerializerNamespaces)
Serializes an object instance to an XML represented string, providing custom namespace prefixes.
Declaration
public static string Serialize<T>(T objectToSerialize, XmlSerializerNamespaces ns)
where T : new()
Parameters
T
objectToSerialize
|
Xml Xml serialization namespace |
Returns
System. An string that represents the serialized object. |
Type Parameters
T
Generic type object to serialize |
SerializeToStream<T>(T)
Serializes an object instance to a stream.
Declaration
public static Stream SerializeToStream<T>(T objectToSerialize)
where T : new()
Parameters
T
objectToSerialize
|
Returns
Stream
An string that represents the serialized object. |
Type Parameters
T
Generic type to serialize |
SerializeToStream<T>(T, XmlSerializerNamespaces)
Serializes an object instance to a stream, providing custom namespace prefixes.
Declaration
public static Stream SerializeToStream<T>(T objectToSerialize, XmlSerializerNamespaces ns)
where T : new()
Parameters
T
objectToSerialize
|
Xml Xml serializer namespace |
Returns
Stream
An string that represents the serialized object. |
Type Parameters
T
Generic type to serialize |