C# Class NMF.Models.Repository.ModelRepository

Represents a standard model repository
Inheritance: IModelRepository
显示文件 Open project: NMFCode/NMF Class Usage Examples

Public Methods

Method Description
ModelRepository ( ) : System

Creates a new model repository with the meta repository as parent

ModelRepository ( IModelRepository parent ) : System

Creates a new model repository with a given parent

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

Resolve ( Uri uri, bool loadOnDemand = true ) : IModelElement

Resolves the given Uri and returns the model element

Resolve ( Uri uri, string hintPath, bool loadOnDemand = true ) : IModelElement

Resolves the given Uri and returns the model element

Resolve ( string path ) : Model

Resolves the given file path for a model element

Save ( IModelElement element, Stream stream, Uri uri ) : void

Saves the given model element to the specified stream

Save ( IModelElement element, string path ) : void

Saves the given model element to the specified stream

Save ( IModelElement element, string path, Uri uri ) : void

Saves the given model element to the specified stream

Protected Methods

Method Description
OnBubbledChange ( BubbledChangeEventArgs e ) : void
OnUnresolvedModelElement ( NMF.Models.Repository.UnresolvedModelElementEventArgs e ) : void

Gets called when a Uri cannot be resolved

Private Methods

Method Description
EnsureModelIsKnown ( IModelElement element ) : void
Parent_BubbledChange ( object sender, BubbledChangeEventArgs e ) : void

Method Details

ModelRepository() public method

Creates a new model repository with the meta repository as parent
public ModelRepository ( ) : System
return System

ModelRepository() public method

Creates a new model repository with a given parent
If no parent repository is provided, the meta repository is used as parent repository
public ModelRepository ( IModelRepository parent ) : System
parent IModelRepository The parent repository
return System

OnBubbledChange() protected method

protected OnBubbledChange ( BubbledChangeEventArgs e ) : void
e BubbledChangeEventArgs
return void

OnUnresolvedModelElement() protected method

Gets called when a Uri cannot be resolved
protected OnUnresolvedModelElement ( NMF.Models.Repository.UnresolvedModelElementEventArgs e ) : void
e NMF.Models.Repository.UnresolvedModelElementEventArgs The event data
return void

Resolve() public method

Resolves the given Uri and returns the model element
public Resolve ( Uri uri, bool loadOnDemand = true ) : IModelElement
uri System.Uri The Uri where to look for the model element
loadOnDemand bool A boolean flag indicating whether the uri should be attempted /// to load, if the model is not already registered with the repository
return IModelElement

Resolve() public method

Resolves the given Uri and returns the model element
public Resolve ( Uri uri, string hintPath, bool loadOnDemand = true ) : IModelElement
uri System.Uri The Uri where to look for the model element
hintPath string The path where the model can be found
loadOnDemand bool A boolean flag indicating whether the uri should be attempted /// to load, if the model is not already registered with the repository
return IModelElement

Resolve() public method

Resolves the given file path for a model element
public Resolve ( string path ) : Model
path string The file path where to look for models
return Model

Save() public method

Saves the given model element to the specified stream
public Save ( IModelElement element, Stream stream, Uri uri ) : void
element IModelElement The model element
stream Stream The stream to save the model element to
uri System.Uri The uri under which the model element shall be retrievable
return void

Save() public method

Saves the given model element to the specified stream
public Save ( IModelElement element, string path ) : void
element IModelElement The model element
path string The path where to save the model element
return void

Save() public method

Saves the given model element to the specified stream
public Save ( IModelElement element, string path, Uri uri ) : void
element IModelElement The model element
path string The path where to save the model element
uri System.Uri The uri under which the model element can be retrieved
return void