Table of Contents

Class ModelSerializationContext

Namespace
NMF.Models.Repository.Serialization
Assembly
NMF.Models.dll

Denotes a context for the serialization of models

public class ModelSerializationContext : XmiSerializationContext
Inheritance
ModelSerializationContext
Inherited Members

Constructors

ModelSerializationContext(IModelRepository, Model)

Creates a new instance

public ModelSerializationContext(IModelRepository repository, Model root)

Parameters

repository IModelRepository

The repository

root Model

The root model element

Properties

Model

Gets the model

public Model Model { get; }

Property Value

Model

Repository

Gets the repository

public IModelRepository Repository { get; }

Property Value

IModelRepository

Methods

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

Gets called when there is a name clash

protected override object OnNameClash(string id, ITypeSerializationInfo type, IEnumerable<object> candidates, object source)

Parameters

id string

The id that was requested

type ITypeSerializationInfo

The type

candidates IEnumerable<object>

The candidates

source object

The source

Returns

object

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

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

Resolves the given id

public override object Resolve(string id, ITypeSerializationInfo type, Type minType = null, bool failOnConflict = true, object source = null)

Parameters

id string

The id that is resolved

type ITypeSerializationInfo

The expected type

minType Type

The minimum type that is required

failOnConflict bool

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

source object

Returns

object

The resolved object