Table of Contents

Class Model

Namespace
NMF.Models
Assembly
NMF.Models.dll

Denotes a container for model elements

[XmlElementName("XMI")]
[XmlNamespace("http://www.omg.org/XMI")]
[XmlNamespacePrefix("xmi")]
[ModelRepresentationClass("http://nmf.codeplex.com/nmeta/#//Model/")]
public class Model : ModelElement, IModel, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
Model
Implements
Inherited Members
Extension Methods

Constructors

Model()

Creates a new instance

public Model()

Properties

Children

Gets the child model elements of this model element

public override IEnumerableExpression<IModelElement> Children { get; }

Property Value

IEnumerableExpression<IModelElement>

ClassInstance

Gets the Class model for this type

public static IClass ClassInstance { get; }

Property Value

IClass

FragmentPrefix

Gets or sets the prefix used for model fragments

public static string FragmentPrefix { get; set; }

Property Value

string

ModelUri

The ModelUri property

public Uri ModelUri { get; set; }

Property Value

Uri

PromoteSingleRootElement

This configuration sets whether a model should be identified with its single root model if such an element exists

public static bool PromoteSingleRootElement { get; set; }

Property Value

bool

ReferencedElements

Gets the referenced model elements of this model element

public override IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

Repository

The repository that manages this model

public IModelRepository Repository { get; }

Property Value

IModelRepository

RootElements

The RootElements property

[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IModelElement> RootElements { get; }

Property Value

IOrderedSetExpression<IModelElement>

Methods

CreateUriForElement(IModelElement)

public virtual Uri CreateUriForElement(IModelElement element)

Parameters

element IModelElement

Returns

Uri

CreateUriWithFragment(string, bool, IModelElement)

Creates the uri with the given fragment starting from the current model element

protected override Uri CreateUriWithFragment(string fragment, bool absolute, IModelElement baseElement = null)

Parameters

fragment string

The fragment starting from this element

absolute bool

True, if an absolute Uri is desired, otherwise false

baseElement IModelElement

The element from which the uri shall be created or null

Returns

Uri

A uri (relative or absolute)

EnsureAllElementsContained()

protected virtual void EnsureAllElementsContained()

GetAttributeValue(string, int)

Resolves the given attribute name

protected override object GetAttributeValue(string attribute, int index)

Parameters

attribute string

The requested attribute name

index int

The index of this attribute

Returns

object

The attribute value or null if it could not be found

GetClass()

Gets the Class for this model element

public override IClass GetClass()

Returns

IClass

GetCollectionForFeature(string)

Gets the Model element collection for the given feature

protected override IList GetCollectionForFeature(string feature)

Parameters

feature string

The requested feature

Returns

IList

A non-generic list of elements

GetCompositionName(object)

Gets the property name for the given container

protected override string GetCompositionName(object container)

Parameters

container object

The container object

Returns

string

The name of the respective container reference

GetModelElementForReference(string, int)

Gets the Model element for the given reference and index

protected override IModelElement GetModelElementForReference(string reference, int index)

Parameters

reference string

The reference name in upper case

index int

The index of the element within the reference

Returns

IModelElement

The model element at the given reference

GetRelativePathForChild(IModelElement)

Gets the relative Uri for the given child element

protected override string GetRelativePathForChild(IModelElement child)

Parameters

child IModelElement

The child element

Returns

string

A relative Uri to resolve the child element

GetRelativePathForNonIdentifiedChild(IModelElement)

Gets the relative Uri for the given child element that is not identified

protected override string GetRelativePathForNonIdentifiedChild(IModelElement child)

Parameters

child IModelElement

The child element

Returns

string

A relative Uri to resolve the child element

OnBubbledChange(BubbledChangeEventArgs)

Fires the BubbledChange event

protected override void OnBubbledChange(BubbledChangeEventArgs e)

Parameters

e BubbledChangeEventArgs

The event data

OnModelUriChanged(ValueChangedEventArgs)

Raises the ModelUriChanged event

protected virtual void OnModelUriChanged(ValueChangedEventArgs eventArgs)

Parameters

eventArgs ValueChangedEventArgs

The event data

OnModelUriChanging(ValueChangedEventArgs)

Raises the ModelUriChanging event

protected virtual void OnModelUriChanging(ValueChangedEventArgs eventArgs)

Parameters

eventArgs ValueChangedEventArgs

The event data

RegisterId(string, ModelElement)

Registers the given model element with the given id

public bool RegisterId(string id, ModelElement element)

Parameters

id string

The identifier

element ModelElement

That element to register with the id

Returns

bool

True, if the registration process was successful. Otherwise, False denotes that already an element with this identifier existed.

Resolve(string)

Resolves the given path starting from the current element

public override IModelElement Resolve(string relativeUri)

Parameters

relativeUri string

The path

Returns

IModelElement

The element corresponding to the given path or null, if no such element could be found

ResolveGlobal(string)

Resolves the given global ID

public IModelElement ResolveGlobal(string id)

Parameters

id string

The given global id

Returns

IModelElement

The model element with the given id or null, if no such element is found

SerializeAsReference(IModelElement)

Determines whether the given reference should be serialized as a reference

protected virtual bool SerializeAsReference(IModelElement element)

Parameters

element IModelElement

Returns

bool

SetFeature(string, object)

Sets a value to the given feature

protected override void SetFeature(string feature, object value)

Parameters

feature string

The requested feature

value object

The value that should be set to that feature

SimplifyUri(Uri)

protected Uri SimplifyUri(Uri target)

Parameters

target Uri

Returns

Uri

UnregisterId(string)

Unregister the given identifier

public bool UnregisterId(string id)

Parameters

id string

The identifier

Returns

bool

True, if the identifier is removed. False denotes that this identifier was not registered

Events

ModelUriChanged

Gets fired when the ModelUri property changed its value

public event EventHandler<ValueChangedEventArgs> ModelUriChanged

Event Type

EventHandler<ValueChangedEventArgs>

ModelUriChanging

Gets fired before the ModelUri property changes its value

public event EventHandler<ValueChangedEventArgs> ModelUriChanging

Event Type

EventHandler<ValueChangedEventArgs>

UnlockRequested

Raised when an unlock was requested for the model

public event EventHandler<UnlockEventArgs> UnlockRequested

Event Type

EventHandler<UnlockEventArgs>