Show / Hide Table of Contents

Class XmlSerializationContext

Denotes the context of a XML deserialization

Inheritance
object
XmlSerializationContext
XmiSerializationContext
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Serialization
Assembly: NMF.Serialization.dll
Syntax
public class XmlSerializationContext

Constructors

| Edit this page View Source

XmlSerializationContext(object)

Creates a new context for a deserialization

Declaration
public XmlSerializationContext(object root)
Parameters
Type Name Description
object root

The root object

Properties

| Edit this page View Source

Root

Gets the deserialization root

Declaration
public object Root { get; }
Property Value
Type Description
object

Methods

| Edit this page View Source

BlockProperty(object, IPropertySerializationInfo)

Blocks the given property for the given instance

Declaration
public void BlockProperty(object value, IPropertySerializationInfo property)
Parameters
Type Name Description
object value

the instance

IPropertySerializationInfo property

the property

| Edit this page View Source

Cleanup()

Ends the deserialization

Declaration
public virtual void Cleanup()
| Edit this page View Source

ContainsId(string, ITypeSerializationInfo)

Determines whether the context knows an element of the given id

Declaration
public virtual bool ContainsId(string id, ITypeSerializationInfo type)
Parameters
Type Name Description
string id

The id of the element

ITypeSerializationInfo type

The expected type of the element

Returns
Type Description
bool

True, if the id can be found, otherwise False

| Edit this page View Source

IsBlocked(object, IPropertySerializationInfo)

Determines whether the given property is blocked for the given instance

Declaration
public bool IsBlocked(object instance, IPropertySerializationInfo property)
Parameters
Type Name Description
object instance

the instance

IPropertySerializationInfo property

the property

Returns
Type Description
bool

True, if the property is blocked, which means that it should be ignored for the deserialization

| Edit this page View Source

OnNameClash(string, ITypeSerializationInfo, IEnumerable<object>, object)

Gets called when there is a name clash

Declaration
protected virtual object OnNameClash(string id, ITypeSerializationInfo type, IEnumerable<object> candidates, object source)
Parameters
Type Name Description
string id

The id that was requested

ITypeSerializationInfo type

The type

IEnumerable<object> candidates

The candidates

object source

The source

Returns
Type Description
object

The object that should be chosen in the case of a clash

| Edit this page View Source

RegisterId(string, object, ITypeSerializationInfo)

Registers an object for the given id

Declaration
public void RegisterId(string id, object value, ITypeSerializationInfo type)
Parameters
Type Name Description
string id

The id that is registered

object value

The object that is registered

ITypeSerializationInfo type

The type for which the value is registered

| Edit this page View Source

Resolve(string, ITypeSerializationInfo, Type, bool, object)

Resolves the given id

Declaration
public virtual object Resolve(string id, ITypeSerializationInfo type, Type minType = null, bool failOnConflict = true, object source = null)
Parameters
Type Name Description
string id

The id that is resolved

ITypeSerializationInfo type

The expected type

Type minType

The minimum type that is required

bool failOnConflict

If false, the method will return null in case of a conflict, otherwise conflict resolution is applied

object source
Returns
Type Description
object

The resolved object

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX