Show / Hide Table of Contents

    Class SerializationHelper

    Helper class to serialize/deserialize any [Serializable] object in a centralized way.

    Inheritance
    object
    SerializationHelper
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Code.Library.Helpers
    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
    Name Description
    T
    | Improve this Doc View Source

    DeserializeObjectUsingBinaryFormatter<T>(string)

    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 Description
    T
    Type Parameters
    Name Description
    T
    | 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 Description
    T
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    SerializeObjectUsingBinaryFormatter<T>(T)

    Serialize an object T using BinaryFormatter.

    Declaration
    public static string SerializeObjectUsingBinaryFormatter<T>(this T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    string
    Type Parameters
    Name Description
    T
    | 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 Description
    string
    Type Parameters
    Name Description
    T
    | 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
    Name Description
    T
    • Improve this Doc
    • View Source
    Back to top Generated by Abhith Rajan using DocFX