Table of Contents

Class Utils.Xml

Namespace
RichHudFramework
Assembly
RichHudClient.dll

Safe wrappers around Space Engineers' built-in XML serialization utilities. Exceptions are caught and returned as KnownException rather than thrown.

public static class Utils.Xml
Inheritance
Utils.Xml

Methods

TryDeserialize<T>(string, out T)

Attempts to deserialize an XML string into an object of the specified type.

Wraps MyAPIGateway.Utilities.SerializeFromXML()

public static KnownException TryDeserialize<T>(string xmlIn, out T obj)

Parameters

xmlIn string

The XML string to deserialize.

obj T

Receives the deserialized instance on success; default(T) on failure.

Returns

KnownException

Null on success; otherwise a KnownException describing the error.

Type Parameters

T

Target type matching the original serialized object.

TrySerialize<T>(T, out string)

Attempts to serialize an object to an XML string.

Wraps MyAPIGateway.Utilities.SerializeToXML()

public static KnownException TrySerialize<T>(T obj, out string xmlOut)

Parameters

obj T

The instance to serialize.

xmlOut string

Receives the XML string on success; null on failure.

Returns

KnownException

Null on success; otherwise a KnownException describing the error.

Type Parameters

T

Type of object to serialize (usually a plain data class).