Share via


SerializationUtilities Class

Definition

Serialization Utilities

public ref class SerializationUtilities abstract sealed
public static class SerializationUtilities
type SerializationUtilities = class
Public Class SerializationUtilities
Inheritance
SerializationUtilities

Fields

ExtensionsXmlElementName

The XML element name for the outer element that contains a list of ExtensionElements.

Methods

AddMessage(SerializationContext, SerializationMessageKind, String, Int32, Int32, KeyValuePair<String,Object>[])

Helper to build a SerializationMessage and store it into the given SerializationContext.

AddMessage(SerializationContext, SerializationMessageKind, String, IXmlLineInfo, KeyValuePair<String,Object>[])

Helper to build a SerializationMessage and store it into the given SerializationContext.

AddMessage(SerializationContext, SerializationMessageKind, XmlException, KeyValuePair<String,Object>[])

Helper to build a SerializationMessage and store it into the given SerializationContext.

AddMessage(SerializationResult, String, SerializationMessageKind, String, Int32, Int32, KeyValuePair<String,Object>[])

Helper to build a SerializationMessage and store it into the given SerializationContext.

AddValidationMessage(SerializationResult, ValidationMessage)

Add a validation message as serialization message, which is used to report load-time validation failures.

GetElementName(ModelElement)

Get the name of a ModelElement for display purpose (e.g. used in error messages).

GetNamespacesFromCurrentNode(XmlReader)

Returns a list of the XML namespaces in the current node

GetPositionInfo(XmlReader, Int32, Int32)

Get the position information from an XmlReader if available.

GetString<T>(SerializationContext, T)

Converts an object of the given type into a string

GetString<T>(T)

Converts an object of the given type into a string

GetValue<T>(SerializationContext, String)

Converts a string to the given type

GetValue<T>(String)

Converts a string to the given type

ReadExtensions(SerializationContext, XmlReader, Partition)

Reads extension elements from the supplied reader.

ResolveDomainModels(XmlReader, ISerializerLocator, Store)

Resolves XML namespace declarations to domain models and loads the domain models into the store.

Skip(XmlReader)

Skip the XmlReader to:

  1. Start tag of the next sibling element.
  2. End tag of the containing parent element.
  3. End of file.
SkipToFirstChild(XmlReader)

Move the reader to the open tag of the first child element.

  • If the reader is not on a open tag (including empty tag), the method does nothing (no move).
  • If the reader doesn't have any nested child element, the method will move the reader to the matching close tag.
SkipToNextElement(XmlReader)

Assign the reader to the start tag of the next element. This is usually used after a ReaderInnerXml() call, where the reader will be positioned after the close tag of the previous element. Since there may be whitespace or comments between the two elements, the reader may not be moved onto the start tag of the next element automatically. If the reader is already on a start tag, this method will do nothing. The method will also stop if an end tag is encountered, which means there's no more siblings and the end of the parent element is reached.

TryGetValue<T>(SerializationContext, String, T)

Try to convert a string into the given type, no exception is thrown.

TryGetValue<T>(String, T)

Try to convert a string into the given type, no exception is thrown.

TryGetValueFromBinaryForm<T>(String, T)

Try to deserialize an input of T type from the given string.

UnescapeXmlString(String)
Obsolete.

Unescape the characters read from XML, e.g. converting &amp; back to &.

WriteDomainModelNamespaces(DomainXmlSerializerDirectory, XmlWriter, String)

Write out the xml namespaces for domain models in the supplied directory

WriteExtensions(SerializationContext, XmlWriter, IEnumerable<ExtensionElement>)

Write the supplied list of extension elements inside an extensions XML element.

Applies to