Ads API .NET library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Google.Api.Ads.Common.Util.SerializationUtilities Class Reference

This class provides utility methods in serializing and deserializing an object as xml. More...

Static Public Member Functions

static object DeserializeFromXmlTextCustomRootNs (string contents, Type contentType, string ns, string rootNode)
 Deserialize an object from xml for a custom root node and xml namespace. More...
 
static object DeserializeFromXmlText (string contents, Type contentType)
 Deserialize an object from xml. More...
 
static string SerializeAsXmlText (object objToSerialize)
 Serializes an object as xml. More...
 
static object CloneObject (object objToClone)
 Clones an object. More...
 

Detailed Description

This class provides utility methods in serializing and deserializing an object as xml.

Member Function Documentation

static object Google.Api.Ads.Common.Util.SerializationUtilities.CloneObject ( object  objToClone)
inlinestatic

Clones an object.

Parameters
objToCloneThe object to clone.
Returns
The cloned object.

objToClone must be Serializable.

static object Google.Api.Ads.Common.Util.SerializationUtilities.DeserializeFromXmlText ( string  contents,
Type  contentType 
)
inlinestatic

Deserialize an object from xml.

Parameters
contentsThe serialized xml.
contentTypeThe type of deserialized object.
Returns
The deserialized object.

contentType must be XmlSerializable.

Referenced by Google.Api.Ads.Common.Lib.AdsOAuthException.AdsOAuthException().

static object Google.Api.Ads.Common.Util.SerializationUtilities.DeserializeFromXmlTextCustomRootNs ( string  contents,
Type  contentType,
string  ns,
string  rootNode 
)
inlinestatic

Deserialize an object from xml for a custom root node and xml namespace.

Parameters
contentsThe serialized xml.
contentTypeThe type of deserialized object.
nsThe xml namespace of the object in serialized xml.
rootNodeThe root node name for the object in serialized xml.
Returns
The deserialized object or null if deserialization fails.

contentType must be XmlSerializable.

static string Google.Api.Ads.Common.Util.SerializationUtilities.SerializeAsXmlText ( object  objToSerialize)
inlinestatic

Serializes an object as xml.

Parameters
objToSerializeThe object to serialize.
Returns
The serialized xml string.

objToSerialize must be XmlSerializable.


The documentation for this class was generated from the following file: