Class ModelSerializationContext
Denotes a context for the serialization of models
Inherited Members
Namespace: NMF.Models.Repository.Serialization
Assembly: NMF.Models.dll
Syntax
public class ModelSerializationContext : XmiSerializationContext
Constructors
| Edit this page View SourceModelSerializationContext(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 SourceModel
Gets the model
Declaration
public Model Model { get; }
Property Value
Type | Description |
---|---|
Model |
Repository
Gets the repository
Declaration
public IModelRepository Repository { get; }
Property Value
Type | Description |
---|---|
IModelRepository |
Methods
| Edit this page View SourceOnNameClash(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
| Edit this page View SourceResolve(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 |