Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Utility Namespace / XmlUtility Class / Serialize Method / Serialize(Object) Method
The object to serialize.
Example
In This Topic
    Serialize(Object) Method
    In This Topic
    Makes XML out of an object.
    Syntax
    public static byte[] Serialize( 
       object objectToSerialize
    )

    Parameters

    objectToSerialize
    The object to serialize.

    Return Value

    An XML string representing the object.
    Example
    Car MyCar1 = new Car();
    byte[] CarBytes = EncodeHelper.Serialize(MyCar1);
    string CarXml = XmlUtility.Utf8BytesToString(CarBytes);
    Car MyCar2 = (Car) Deserialize(CarXml, typeof(Car));
    // MyCar2 is now a copy of MyCar1.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also