Class SerializationHelper
Helper class to serialize/deserialize any [Serializable] object in a centralized way.
Inheritance
SerializationHelper
Assembly: Code.Library.dll
Syntax
public static class SerializationHelper
Methods
|
Improve this Doc
View Source
DeserializeFromXML<T>(string)
De-serialize a [Serializable] object of type T into an XML-formatted string using XmlSerializer
Declaration
public static T DeserializeFromXML<T>(string xml)
Parameters
| Type |
Name |
Description |
| string |
xml |
|
Returns
| Type |
Description |
| T |
an XML-formatted string
|
Type Parameters
|
Improve this Doc
View Source
De-serialize a BinaryFormatter-serialized string into an object of type T.
Declaration
public static T DeserializeObjectUsingBinaryFormatter<T>(string str)
Parameters
| Type |
Name |
Description |
| string |
str |
|
Returns
Type Parameters
|
Improve this Doc
View Source
DeserializeObject<T>(string)
De-serialize an XML/UTF8 string into an object of type T.
Declaration
public static T DeserializeObject<T>(string xml)
Parameters
| Type |
Name |
Description |
| string |
xml |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Serialize an object T using BinaryFormatter.
Declaration
public static string SerializeObjectUsingBinaryFormatter<T>(this T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
Type Parameters
|
Improve this Doc
View Source
SerializeObject<T>(T)
Serialize a [Serializable] object of type T into an XML/UTF8 string.
Declaration
public static string SerializeObject<T>(this T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
Type Parameters
|
Improve this Doc
View Source
SerializeToXML<T>(T)
Serialize a [Serializable] object of type T into an XML-formatted string using XmlSerializer
Declaration
public static string SerializeToXML<T>(this T value)
Parameters
| Type |
Name |
Description |
| T |
value |
any T object
|
Returns
| Type |
Description |
| string |
an XML-formatted string
|
Type Parameters