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
IModelRepositoryThe repository
root
ModelThe 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
id
stringThe id that was requested
type
ITypeSerializationInfoThe type
candidates
IEnumerable<object>The candidates
source
objectThe 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
stringThe id that is resolved
type
ITypeSerializationInfoThe expected type
minType
TypeThe minimum type that is required
failOnConflict
boolIf false, the method will return null in case of a conflict, otherwise conflict resolution is applied
source
object
Returns
- object
The resolved object