Show / Hide Table of Contents

Class ModelSerializationContext

Denotes a context for the serialization of models

Inheritance
object
XmlSerializationContext
XmiSerializationContext
ModelSerializationContext
Inherited Members
XmiSerializationContext.GetId(object)
XmiSerializationContext.SetId(object, string)
XmiSerializationContext.IDs
XmlSerializationContext.Cleanup()
XmlSerializationContext.RegisterId(string, object, ITypeSerializationInfo)
XmlSerializationContext.ContainsId(string, ITypeSerializationInfo)
XmlSerializationContext.IsBlocked(object, IPropertySerializationInfo)
XmlSerializationContext.BlockProperty(object, IPropertySerializationInfo)
XmlSerializationContext.Root
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Models.Repository.Serialization
Assembly: NMF.Models.dll
Syntax
public class ModelSerializationContext : XmiSerializationContext

Constructors

| Edit this page View Source

ModelSerializationContext(IModelRepository, Model)

Creates a new instance

Declaration
public ModelSerializationContext(IModelRepository repository, Model root)
Parameters
Type Name Description
IModelRepository repository

The repository

Model root

The root model element

Properties

| Edit this page View Source

Model

Gets the model

Declaration
public Model Model { get; }
Property Value
Type Description
Model
| Edit this page View Source

Repository

Gets the repository

Declaration
public IModelRepository Repository { get; }
Property Value
Type Description
IModelRepository

Methods

| Edit this page View Source

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

Gets called when there is a name clash

Declaration
protected override 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

Overrides
XmlSerializationContext.OnNameClash(string, ITypeSerializationInfo, IEnumerable<object>, object)
| Edit this page View Source

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

Resolves the given id

Declaration
public override 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

Overrides
XmlSerializationContext.Resolve(string, ITypeSerializationInfo, Type, bool, object)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX