Show / Hide Table of Contents

Interface IModelElement

Defines the interface of a model element in NMF

Inherited Members
INotifyPropertyChanged.PropertyChanged
INotifyPropertyChanging.PropertyChanging
Namespace: NMF.Models
Assembly: NMF.Models.dll
Syntax
[ModelRepresentationClass("http://nmf.codeplex.com/nmeta/#//ModelElement/")]
public interface IModelElement : INotifyPropertyChanged, INotifyPropertyChanging

Properties

| Edit this page View Source

AbsoluteUri

Gets the absolute Uri for this model element

Declaration
Uri AbsoluteUri { get; }
Property Value
Type Description
Uri
| Edit this page View Source

Children

Gets the children of the current model element

Declaration
IEnumerableExpression<IModelElement> Children { get; }
Property Value
Type Description
IEnumerableExpression<IModelElement>
| Edit this page View Source

Extensions

Gets the extensions for the current model element

Declaration
ICollectionExpression<ModelElementExtension> Extensions { get; }
Property Value
Type Description
ICollectionExpression<ModelElementExtension>
| Edit this page View Source

IsFrozen

Determines whether the model elements and all elements underneath are frozen

Declaration
bool IsFrozen { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsIdentified

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

Declaration
bool IsIdentified { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsLocked

Determines whether the model elements and all elements underneath are locked

Declaration
bool IsLocked { get; }
Property Value
Type Description
bool
| Edit this page View Source

Model

Gets the model that contains the current model element

Declaration
Model Model { get; }
Property Value
Type Description
Model
| Edit this page View Source

Parent

Gets the container of the current model element

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

ReferencedElements

Gets the model elements referenced by the current model element

Declaration
IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Type Description
IEnumerableExpression<IModelElement>
| Edit this page View Source

RelativeUri

Gets the relative Uri of this model element

Declaration
Uri RelativeUri { get; }
Property Value
Type Description
Uri

Methods

| Edit this page View Source

CallOperation(IOperation, params object[])

Calls the given operation

Declaration
object CallOperation(IOperation operation, params object[] arguments)
Parameters
Type Name Description
IOperation operation

The operation that should be called

object[] arguments

The arguments used to call the operation

Returns
Type Description
object

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

| Edit this page View Source

Delete()

Deletes the current model element

Declaration
void Delete()
| Edit this page View Source

Freeze()

Freezes this model element such that it becomes immutable.

Declaration
void Freeze()
| Edit this page View Source

GetAttributeValue(IAttribute, int)

Gets the value for the given attribute and index

Declaration
object GetAttributeValue(IAttribute attribute, int index = 0)
Parameters
Type Name Description
IAttribute attribute

The attribute

int index

The index within the attribute

Returns
Type Description
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

| Edit this page View Source

GetAttributeValues(IAttribute)

Gets the values of the given attribute as a list

Declaration
IList GetAttributeValues(IAttribute attribute)
Parameters
Type Name Description
IAttribute attribute

The attribute

Returns
Type Description
IList

A non-generic list of values

| Edit this page View Source

GetClass()

Gets the class of the model element

Declaration
IClass GetClass()
Returns
Type Description
IClass

The class of the model element

| Edit this page View Source

GetContainerReference(IModelElement, out int)

Gets the container reference for the given child element

Declaration
IReference GetContainerReference(IModelElement child, out int index)
Parameters
Type Name Description
IModelElement child

The child element

int index

The index of the child in the returned reference

Returns
Type Description
IReference

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

| Edit this page View Source

GetExtension<T>()

Gets the extension of the given extension type

Declaration
T GetExtension<T>() where T : ModelElementExtension
Returns
Type Description
T

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

Type Parameters
Name Description
T

The extension type

| Edit this page View Source

GetReferencedElement(IReference, int)

Gets the referenced model element for the given reference and index

Declaration
IModelElement GetReferencedElement(IReference reference, int index = 0)
Parameters
Type Name Description
IReference reference

The reference

int index

The index within the reference

Returns
Type Description
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

| Edit this page View Source

GetReferencedElements(IReference)

Gets the referen

Declaration
IList GetReferencedElements(IReference reference)
Parameters
Type Name Description
IReference reference
Returns
Type Description
IList
| Edit this page View Source

Lock()

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

Declaration
void Lock()
| Edit this page View Source

Resolve(Uri)

Resolves the given relative Uri from the current model element

Declaration
IModelElement Resolve(Uri relativeUri)
Parameters
Type Name Description
Uri relativeUri

A relative uri describing the path to the desired child element

Returns
Type Description
IModelElement

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

| Edit this page View Source

SetAttributeValue(IAttribute, object)

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

Declaration
void SetAttributeValue(IAttribute attribute, object value)
Parameters
Type Name Description
IAttribute attribute

The attribute

object value

The value that should be set

| Edit this page View Source

SetReferencedElement(IReference, IModelElement)

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

Declaration
void SetReferencedElement(IReference reference, IModelElement element)
Parameters
Type Name Description
IReference reference

The reference

IModelElement element

The element that should be set

| Edit this page View Source

ToIdentifierString()

Gets an identification string of the model element

Declaration
string ToIdentifierString()
Returns
Type Description
string
| Edit this page View Source

TryUnlock()

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

Declaration
bool TryUnlock()
Returns
Type Description
bool

True, if unlocking the model element succeeds, otherwise False

| Edit this page View Source

Unlock()

Unlocks this model element.

Declaration
void Unlock()
Exceptions
Type Condition
LockedException

thrown if the model element could not be unlocked

Events

| Edit this page View Source

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

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

Deleted

This event is fired after the model element is deleted

Declaration
event EventHandler<UriChangedEventArgs> Deleted
Event Type
Type Description
EventHandler<UriChangedEventArgs>
| Edit this page View Source

Deleting

This event is fired before the model element is deleted

Declaration
event EventHandler<UriChangedEventArgs> Deleting
Event Type
Type Description
EventHandler<UriChangedEventArgs>
| Edit this page View Source

ParentChanged

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

Declaration
event EventHandler<ValueChangedEventArgs> ParentChanged
Event Type
Type Description
EventHandler<ValueChangedEventArgs>

Extension Methods

ModelExtensions.AncestorTree(IModelElement)
ModelExtensions.Ancestors(IModelElement)
ModelExtensions.Descendants(IModelElement)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX