Table of Contents

Interface IModelElement

Namespace
NMF.Models
Assembly
NMF.Models.dll

Defines the interface of a model element in NMF

[ModelRepresentationClass("http://nmf.codeplex.com/nmeta/#//ModelElement/")]
public interface IModelElement : INotifyPropertyChanged, INotifyPropertyChanging
Inherited Members
Extension Methods

Properties

AbsoluteUri

Gets the absolute Uri for this model element

Uri AbsoluteUri { get; }

Property Value

Uri

Children

Gets the children of the current model element

IEnumerableExpression<IModelElement> Children { get; }

Property Value

IEnumerableExpression<IModelElement>

ClassName

Gets the name of the class

string ClassName { get; }

Property Value

string

Extensions

Gets the extensions for the current model element

ICollectionExpression<ModelElementExtension> Extensions { get; }

Property Value

ICollectionExpression<ModelElementExtension>

IdentifierString

Gets the string representation of the identifier

string IdentifierString { get; }

Property Value

string

IsFrozen

Determines whether the model elements and all elements underneath are frozen

bool IsFrozen { get; }

Property Value

bool

IsIdentified

Gets a value indicating whether this item can be identified through its ToString value

bool IsIdentified { get; }

Property Value

bool

IsLocked

Determines whether the model elements and all elements underneath are locked

bool IsLocked { get; }

Property Value

bool

Model

Gets the model that contains the current model element

Model Model { get; }

Property Value

Model

Parent

Gets the container of the current model element

IModelElement Parent { get; set; }

Property Value

IModelElement

ReferencedElements

Gets the model elements referenced by the current model element

IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

RelativeUri

Gets the relative Uri of this model element

Uri RelativeUri { get; }

Property Value

Uri

Methods

CallOperation(IOperation, params object[])

Calls the given operation

object CallOperation(IOperation operation, params object[] arguments)

Parameters

operation IOperation

The operation that should be called

arguments object[]

The arguments used to call the operation

Returns

object

The operation result or null, if the operation does not return any value

Delete()

Deletes the current model element

void Delete()

Freeze()

Freezes this model element such that it becomes immutable.

void Freeze()

GetAttributeValue(IAttribute, int)

Gets the value for the given attribute and index

object GetAttributeValue(IAttribute attribute, int index = 0)

Parameters

attribute IAttribute

The attribute

index int

The index within the attribute

Returns

object

The value for the given attribute. If this is a collection and the index parameter is specified, the method returns the value at the given index

GetAttributeValues(IAttribute)

Gets the values of the given attribute as a list

IList GetAttributeValues(IAttribute attribute)

Parameters

attribute IAttribute

The attribute

Returns

IList

A non-generic list of values

GetClass()

Gets the class of the model element

IClass GetClass()

Returns

IClass

The class of the model element

GetContainerReference(IModelElement, out int)

Gets the container reference for the given child element

IReference GetContainerReference(IModelElement child, out int index)

Parameters

child IModelElement

The child element

index int

The index of the child in the returned reference

Returns

IReference

A composition reference or null, if the child is not contained in the model element

GetExtension<T>()

Gets the extension of the given extension type

T GetExtension<T>() where T : ModelElementExtension

Returns

T

The extension instance for this model element or null, if the extension type was not applied to the current model element

Type Parameters

T

The extension type

GetReferencedElement(IReference, int)

Gets the referenced model element for the given reference and index

IModelElement GetReferencedElement(IReference reference, int index = 0)

Parameters

reference IReference

The reference

index int

The index within the reference

Returns

IModelElement

The value for the given reference. If this is a collection and the index parameter is specified, the method returns the referenced element at the given index

GetReferencedElements(IReference)

Gets the referen

IList GetReferencedElements(IReference reference)

Parameters

reference IReference

Returns

IList

Lock()

Locks this model element against any changes (can be undone)

void Lock()

Resolve(string)

Resolves the given relative Uri from the current model element

IModelElement Resolve(string relativeUri)

Parameters

relativeUri string

A relative uri describing the path to the desired child element

Returns

IModelElement

The corresponding child element or null, if no such was found

Resolve(Uri)

Resolves the given relative Uri from the current model element

IModelElement Resolve(Uri relativeUri)

Parameters

relativeUri Uri

A relative uri describing the path to the desired child element

Returns

IModelElement

The corresponding child element or null, if no such was found

SetAttributeValue(IAttribute, object)

Sets the value of the current model element for the given attribute

void SetAttributeValue(IAttribute attribute, object value)

Parameters

attribute IAttribute

The attribute

value object

The value that should be set

SetReferencedElement(IReference, IModelElement)

Sets the referenced element of the current model element for the given reference

void SetReferencedElement(IReference reference, IModelElement element)

Parameters

reference IReference

The reference

element IModelElement

The element that should be set

ToIdentifierString()

Gets an identification string of the model element

string ToIdentifierString()

Returns

string

TryUnlock()

Tries to unlock the current model element in order to make changes possible

bool TryUnlock()

Returns

bool

True, if unlocking the model element succeeds, otherwise False

Unlock()

Unlocks this model element.

void Unlock()

Exceptions

LockedException

thrown if the model element could not be unlocked

Events

BubbledChange

Gets fired when an elementary change happens in the composition hierarchy rooted at the current element. The original elementary change can be retrieved in the event data

event EventHandler<BubbledChangeEventArgs> BubbledChange

Event Type

EventHandler<BubbledChangeEventArgs>

Deleted

This event is fired after the model element is deleted

event EventHandler<UriChangedEventArgs> Deleted

Event Type

EventHandler<UriChangedEventArgs>

Deleting

This event is fired before the model element is deleted

event EventHandler<UriChangedEventArgs> Deleting

Event Type

EventHandler<UriChangedEventArgs>

ParentChanged

Gets fired when the container of the current model element has changed

event EventHandler<ValueChangedEventArgs> ParentChanged

Event Type

EventHandler<ValueChangedEventArgs>