Show / Hide Table of Contents

Class ModelRepository

Represents a standard model repository

Inheritance
object
ModelRepository
Implements
IModelRepository
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NMF.Models.Repository
Assembly: NMF.Models.dll
Syntax
public class ModelRepository : IModelRepository

Constructors

| Edit this page View Source

ModelRepository()

Creates a new model repository with the meta repository as parent

Declaration
public ModelRepository()
| Edit this page View Source

ModelRepository(IModelRepository)

Creates a new model repository with a given parent

Declaration
public ModelRepository(IModelRepository parent)
Parameters
Type Name Description
IModelRepository parent

The parent repository

Remarks

If no parent repository is provided, the meta repository is used as parent repository

| Edit this page View Source

ModelRepository(IModelRepository, IModelSerializer, params IModelLocator[])

Creates a new model repository with a given parent

Declaration
public ModelRepository(IModelRepository parent, IModelSerializer serializer, params IModelLocator[] locators)
Parameters
Type Name Description
IModelRepository parent

The parent repository

IModelSerializer serializer

A serializer object or null to use the default

IModelLocator[] locators

A set of model locators

Remarks

If no parent repository is provided, the meta repository is used as parent repository

Properties

| Edit this page View Source

Locators

Gets a collection of model locators

Declaration
public ICollection<IModelLocator> Locators { get; }
Property Value
Type Description
ICollection<IModelLocator>
| Edit this page View Source

Models

Gets a dictionary of the models loaded to this repository

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

Parent

Gets the parent model repository.

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

Serializer

Gets or sets the serializer that is used for the deserialization of the models

Declaration
public IModelSerializer Serializer { get; set; }
Property Value
Type Description
IModelSerializer

Methods

| Edit this page View Source

OnBubbledChange(BubbledChangeEventArgs)

Declaration
protected virtual void OnBubbledChange(BubbledChangeEventArgs e)
Parameters
Type Name Description
BubbledChangeEventArgs e
| Edit this page View Source

OnUnresolvedModelElement(UnresolvedModelElementEventArgs)

Gets called when a Uri cannot be resolved

Declaration
protected virtual void OnUnresolvedModelElement(UnresolvedModelElementEventArgs e)
Parameters
Type Name Description
UnresolvedModelElementEventArgs e

The event data

| Edit this page View Source

Resolve(string)

Resolves the given file path for a model element

Declaration
public Model Resolve(string path)
Parameters
Type Name Description
string path

The file path where to look for models

Returns
Type Description
Model

The model at this file path or null if the file cannot be found

| Edit this page View Source

Resolve(Uri, bool)

Resolves the given Uri and returns the model element

Declaration
public IModelElement Resolve(Uri uri, bool loadOnDemand = true)
Parameters
Type Name Description
Uri uri

The Uri where to look for the model element

bool loadOnDemand

A boolean flag indicating whether the uri should be attempted to load, if the model is not already registered with the repository

Returns
Type Description
IModelElement

A model element at the given Uri or null if none can be found

| Edit this page View Source

Resolve(Uri, string, bool)

Resolves the given Uri and returns the model element

Declaration
public IModelElement Resolve(Uri uri, string hintPath, bool loadOnDemand = true)
Parameters
Type Name Description
Uri uri

The Uri where to look for the model element

string hintPath

The path where the model can be found

bool loadOnDemand

A boolean flag indicating whether the uri should be attempted to load, if the model is not already registered with the repository

Returns
Type Description
IModelElement

A model element at the given Uri or null if none can be found

| Edit this page View Source

Save(IModelElement, Stream, Uri)

Saves the given model element to the specified stream

Declaration
public void Save(IModelElement element, Stream stream, Uri uri)
Parameters
Type Name Description
IModelElement element

The model element

Stream stream

The stream to save the model element to

Uri uri

The uri under which the model element shall be retrievable

| Edit this page View Source

Save(IModelElement, string)

Saves the given model element to the specified stream

Declaration
public void Save(IModelElement element, string path)
Parameters
Type Name Description
IModelElement element

The model element

string path

The path where to save the model element

| Edit this page View Source

Save(IModelElement, string, Uri)

Saves the given model element to the specified stream

Declaration
public void Save(IModelElement element, string path, Uri uri)
Parameters
Type Name Description
IModelElement element

The model element

string path

The path where to save the model element

Uri uri

The uri under which the model element can be retrieved

Events

| Edit this page View Source

BubbledChange

Declaration
public event EventHandler<BubbledChangeEventArgs> BubbledChange
Event Type
Type Description
EventHandler<BubbledChangeEventArgs>
| Edit this page View Source

UnresolvedModelElement

Gets fired when a Uri cannot be resolved

Declaration
public event EventHandler<UnresolvedModelElementEventArgs> UnresolvedModelElement
Event Type
Type Description
EventHandler<UnresolvedModelElementEventArgs>

Implements

IModelRepository
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX