SaaS CMS has officially launched! Learn more now.

Class McXmlSerializer

Provides XML serializer utility methods.

Inheritance
System.Object
McXmlSerializer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 11.8.3
Syntax
public static class McXmlSerializer

Methods

GetObject(String, String)

Gets the object.

Declaration
public static object GetObject(string typeName, string value)
Parameters
Type Name Description
System.String typeName

Name of the type.

System.String value

The value.

Returns
Type Description
System.Object

GetObject(Type, String)

Gets the object.

Declaration
public static object GetObject(Type type, string value)
Parameters
Type Name Description
System.Type type

The type.

System.String value

The value.

Returns
Type Description
System.Object

GetObject(Type, String, Type[])

Gets the object.

Declaration
public static object GetObject(Type type, string value, params Type[] extraTypes)
Parameters
Type Name Description
System.Type type

The type.

System.String value

The value.

System.Type[] extraTypes

The extra types.

Returns
Type Description
System.Object

GetObject<T>(String)

Gets the object.

Declaration
public static T GetObject<T>(string value)
Parameters
Type Name Description
System.String value

The value.

Returns
Type Description
T
Type Parameters
Name Description
T

GetObject<T>(String, Type[])

Gets the object.

Declaration
public static T GetObject<T>(string value, params Type[] extraTypes)
Parameters
Type Name Description
System.String value

The value.

System.Type[] extraTypes

The extra types.

Returns
Type Description
T
Type Parameters
Name Description
T

GetObject<TXmlSer, T>(String)

Gets the object.

Declaration
public static T GetObject<TXmlSer, T>(string value)
    where TXmlSer : XmlSerializer, new()
Parameters
Type Name Description
System.String value

The value.

Returns
Type Description
T
Type Parameters
Name Description
TXmlSer
T

GetObjectFromFile<T>(String)

Gets the object from file.

Declaration
public static T GetObjectFromFile<T>(string path)
Parameters
Type Name Description
System.String path

The path.

Returns
Type Description
T
Type Parameters
Name Description
T

GetObjectFromFile<T>(String, Type[])

Gets the object from file.

Declaration
public static T GetObjectFromFile<T>(string path, params Type[] extraTypes)
Parameters
Type Name Description
System.String path

The path.

System.Type[] extraTypes

The extra types.

Returns
Type Description
T
Type Parameters
Name Description
T

GetString(Type, Object)

Gets the string.

Declaration
public static string GetString(Type type, object value)
Parameters
Type Name Description
System.Type type

The type.

System.Object value

The value.

Returns
Type Description
System.String

GetString<T>(T)

Gets the string.

Declaration
public static string GetString<T>(T value)
Parameters
Type Name Description
T value

The value.

Returns
Type Description
System.String
Type Parameters
Name Description
T

GetString<T>(T, Type[])

Gets the string.

Declaration
public static string GetString<T>(T value, params Type[] extraTypes)
Parameters
Type Name Description
T value

The value.

System.Type[] extraTypes

The extra types.

Returns
Type Description
System.String
Type Parameters
Name Description
T

GetString<TXmlSer, T>(T)

Gets the string.

Declaration
public static string GetString<TXmlSer, T>(T value)
    where TXmlSer : XmlSerializer, new()
Parameters
Type Name Description
T value

The value.

Returns
Type Description
System.String
Type Parameters
Name Description
TXmlSer
T

SaveObjectToFile<T>(String, T)

Gets the file.

Declaration
public static void SaveObjectToFile<T>(string path, T value)
Parameters
Type Name Description
System.String path

The path.

T value

The value.

Type Parameters
Name Description
T

SaveObjectToFile<T>(String, T, Type[])

Saves the object to file.

Declaration
public static void SaveObjectToFile<T>(string path, T value, params Type[] extraTypes)
Parameters
Type Name Description
System.String path

The path.

T value

The value.

System.Type[] extraTypes

The extra types.

Type Parameters
Name Description
T