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
repositoryIModelRepositoryThe repository
rootModelThe root model element
Properties
Model
Gets the model
public Model Model { get; }
Property Value
Repository
Gets the repository
public IModelRepository Repository { get; }
Property Value
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
idstringThe id that was requested
typeITypeSerializationInfoThe type
candidatesIEnumerable<object>The candidates
sourceobjectThe 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
idstringThe id that is resolved
typeITypeSerializationInfoThe expected type
minTypeTypeThe minimum type that is required
failOnConflictboolIf false, the method will return null in case of a conflict, otherwise conflict resolution is applied
sourceobject
Returns
- object
The resolved object