Table of Contents

Class XmiSerializer

Namespace
NMF.Serialization.Xmi
Assembly
NMF.Serialization.dll

Denotes a serializer implementation that serializes objects to XMI

public class XmiSerializer : XmlSerializer
Inheritance
XmiSerializer
Derived
Inherited Members

Constructors

XmiSerializer()

Creates a new XmiSerializer with default settings and no preloaded types

public XmiSerializer()

XmiSerializer(XmlSerializationSettings)

Creates a new XmiSerializer with the specified settings

public XmiSerializer(XmlSerializationSettings settings)

Parameters

settings XmlSerializationSettings

Serializer-settings for the serializer. Can be null or Nothing in Visual Basic. In this case, the default settings will be used.

XmiSerializer(XmlSerializationSettings, IEnumerable<Type>)

Creates a new XmiSerializer with the specified settings and the given preloaded types

public XmiSerializer(XmlSerializationSettings settings, IEnumerable<Type> additionalTypes)

Parameters

settings XmlSerializationSettings

The settings to use for the serializer

additionalTypes IEnumerable<Type>

Set of types to load into the serializer

Remarks

The types will be loaded with the specified settings

XmiSerializer(XmlSerializer)

Creates a new XmlSerializer and copies settings and known types from the given serializer

public XmiSerializer(XmlSerializer parent)

Parameters

parent XmlSerializer

An XML serializer to copy settings and known type information from

XmiSerializer(XmlSerializer, XmlSerializationSettings)

Creates a new XmlSerializer and copies settings and known types from the given serializer

public XmiSerializer(XmlSerializer parent, XmlSerializationSettings settings)

Parameters

parent XmlSerializer

An XML serializer to copy settings and known type information from

settings XmlSerializationSettings

New settings

XmiSerializer(IEnumerable<Type>)

Creates a new XmiSerializer with default settings

public XmiSerializer(IEnumerable<Type> additionalTypes)

Parameters

additionalTypes IEnumerable<Type>

Set of types to preload into the serializer

Remarks

Types will be loaded with default settings

Fields

XMINamespace

Denotes the XMI namespace

public static readonly string XMINamespace

Field Value

string

XMIPrefix

Denotes the standard prefix for the XMI namespace

public static readonly string XMIPrefix

Field Value

string

XMLSchemaInstanceNamespace

Denotes the namespace for XML schema instance

public static readonly string XMLSchemaInstanceNamespace

Field Value

string

XMLSchemaInstancePrefix

Denotes the standard prefix to use for the XML schema instance namespace

public static readonly string XMLSchemaInstancePrefix

Field Value

string

Properties

IdAttribute

Gets the attribute used for identifiers

protected virtual IPropertySerializationInfo IdAttribute { get; }

Property Value

IPropertySerializationInfo

RootPrefix

Gets or sets the root prefix

public string RootPrefix { get; set; }

Property Value

string

Methods

CreateSerializationContext(object)

Creates a serialization context for the given root element

protected override XmlSerializationContext CreateSerializationContext(object root)

Parameters

root object

The root element of the serialization

Returns

XmlSerializationContext

A serialization context

GetElementTypeInfo(XmlReader, IPropertySerializationInfo)

Gets the type information for the current property

protected override ITypeSerializationInfo GetElementTypeInfo(XmlReader reader, IPropertySerializationInfo property)

Parameters

reader XmlReader

The xml reader

property IPropertySerializationInfo

The current property

Returns

ITypeSerializationInfo

The type serialization info that should be used in the remainder

GoToPropertyContent(XmlReader)

Moves the reader to the content of the property

protected override bool GoToPropertyContent(XmlReader reader)

Parameters

reader XmlReader

the Xml reader

Returns

bool

true, if the reader could be moved sucessfully, otherwise false

HandleUnknownAttribute(XmlReader, object, ITypeSerializationInfo, XmlSerializationContext)

Handles an attribute that was not known to the serializer

protected override void HandleUnknownAttribute(XmlReader reader, object obj, ITypeSerializationInfo info, XmlSerializationContext context)

Parameters

reader XmlReader

The current reader position

obj object

The object that is currently deserialized

info ITypeSerializationInfo

The type serialization information of the object

context XmlSerializationContext

The serialization context

InitializeElementProperties(XmlReader, ref object, ITypeSerializationInfo, XmlSerializationContext)

Initializes the element properties from the xml reader position

protected override void InitializeElementProperties(XmlReader reader, ref object obj, ITypeSerializationInfo info, XmlSerializationContext context)

Parameters

reader XmlReader

the xml reader

obj object

the element

info ITypeSerializationInfo

the type serialization information

context XmlSerializationContext

the serialization context

InitializeTypeSerializationInfo(Type, ITypeSerializationInfo)

Initializes the given type serialization information for the given type

protected override void InitializeTypeSerializationInfo(Type type, ITypeSerializationInfo serializationInfo)

Parameters

type Type

the system type

serializationInfo ITypeSerializationInfo

the serialization information object

OverrideIdentifiedObject(object, XmlReader, XmlSerializationContext)

Determines whether the already identified element should be overridden

protected override bool OverrideIdentifiedObject(object obj, XmlReader reader, XmlSerializationContext context)

Parameters

obj object

The object that would be overridden

reader XmlReader

The current reader position

context XmlSerializationContext

The serialization context

Returns

bool

true, if the element shall be overridden, otherwise false

WriteBeginElement(XmlWriter, object, ITypeSerializationInfo)

Writes the beginning of an element

protected override void WriteBeginElement(XmlWriter writer, object obj, ITypeSerializationInfo info)

Parameters

writer XmlWriter

The xml writer to write to

obj object

The element

info ITypeSerializationInfo

The serialization information of the objects type

WriteBeginRootElement(XmlWriter, object, ITypeSerializationInfo)

Writes the root element to the given writer

protected override void WriteBeginRootElement(XmlWriter writer, object root, ITypeSerializationInfo info)

Parameters

writer XmlWriter

The xml writer to write to

root object

The root element

info ITypeSerializationInfo

The serialization information of the objects type

WriteElementProperties(XmlWriter, object, ITypeSerializationInfo, XmlSerializationContext)

Writes the element properties of the given object to the provided writer

protected override void WriteElementProperties(XmlWriter writer, object obj, ITypeSerializationInfo info, XmlSerializationContext context)

Parameters

writer XmlWriter

The xml writer to write to

obj object

The element

info ITypeSerializationInfo

The serialization information of the objects type

context XmlSerializationContext

The serialization context

WriteEndElement(XmlWriter, object, ITypeSerializationInfo)

Completes the current element for the provided object

protected override void WriteEndElement(XmlWriter writer, object obj, ITypeSerializationInfo info)

Parameters

writer XmlWriter

The xml writer to write to

obj object

The element

info ITypeSerializationInfo

The serialization information of the objects type

WriteEndRootElement(XmlWriter, object, ITypeSerializationInfo)

Completes the root element

protected override void WriteEndRootElement(XmlWriter writer, object root, ITypeSerializationInfo info)

Parameters

writer XmlWriter

The xml writer to write to

root object

The element

info ITypeSerializationInfo

The serialization information of the objects type

WriteIdentifiedObject(XmlWriter, object, XmlIdentificationMode, ITypeSerializationInfo, XmlSerializationContext)

Writes the provided identified object

protected override bool WriteIdentifiedObject(XmlWriter writer, object obj, XmlIdentificationMode identificationMode, ITypeSerializationInfo info, XmlSerializationContext context)

Parameters

writer XmlWriter

The xml writer to write to

obj object

The element

identificationMode XmlIdentificationMode

The identification mode for the current object

info ITypeSerializationInfo

The serialization information of the objects type

context XmlSerializationContext

The serialization context

Returns

bool

true, if the object could be written as identified object, otherwise false