Interface IModelElement
Defines the interface of a model element in NMF
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 SourceAbsoluteUri
Gets the absolute Uri for this model element
Declaration
Uri AbsoluteUri { get; }
Property Value
Type | Description |
---|---|
Uri |
Children
Gets the children of the current model element
Declaration
IEnumerableExpression<IModelElement> Children { get; }
Property Value
Type | Description |
---|---|
IEnumerableExpression<IModelElement> |
Extensions
Gets the extensions for the current model element
Declaration
ICollectionExpression<ModelElementExtension> Extensions { get; }
Property Value
Type | Description |
---|---|
ICollectionExpression<ModelElementExtension> |
IsFrozen
Determines whether the model elements and all elements underneath are frozen
Declaration
bool IsFrozen { get; }
Property Value
Type | Description |
---|---|
bool |
IsIdentified
Gets a value indicating whether this item can be identified through its ToString value
Declaration
bool IsIdentified { get; }
Property Value
Type | Description |
---|---|
bool |
IsLocked
Determines whether the model elements and all elements underneath are locked
Declaration
bool IsLocked { get; }
Property Value
Type | Description |
---|---|
bool |
Model
Gets the model that contains the current model element
Declaration
Model Model { get; }
Property Value
Type | Description |
---|---|
Model |
Parent
Gets the container of the current model element
Declaration
IModelElement Parent { get; set; }
Property Value
Type | Description |
---|---|
IModelElement |
ReferencedElements
Gets the model elements referenced by the current model element
Declaration
IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Type | Description |
---|---|
IEnumerableExpression<IModelElement> |
RelativeUri
Gets the relative Uri of this model element
Declaration
Uri RelativeUri { get; }
Property Value
Type | Description |
---|---|
Uri |
Methods
| Edit this page View SourceCallOperation(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 |
Delete()
Deletes the current model element
Declaration
void Delete()
Freeze()
Freezes this model element such that it becomes immutable.
Declaration
void Freeze()
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 |
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 |
GetClass()
Gets the class of the model element
Declaration
IClass GetClass()
Returns
Type | Description |
---|---|
IClass | The class of the model element |
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 |
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 |
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 |
GetReferencedElements(IReference)
Gets the referen
Declaration
IList GetReferencedElements(IReference reference)
Parameters
Type | Name | Description |
---|---|---|
IReference | reference |
Returns
Type | Description |
---|---|
IList |
Lock()
Locks this model element against any changes (can be undone)
Declaration
void Lock()
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 |
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 |
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 |
ToIdentifierString()
Gets an identification string of the model element
Declaration
string ToIdentifierString()
Returns
Type | Description |
---|---|
string |
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 |
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 SourceBubbledChange
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> |
Deleted
This event is fired after the model element is deleted
Declaration
event EventHandler<UriChangedEventArgs> Deleted
Event Type
Type | Description |
---|---|
EventHandler<UriChangedEventArgs> |
Deleting
This event is fired before the model element is deleted
Declaration
event EventHandler<UriChangedEventArgs> Deleting
Event Type
Type | Description |
---|---|
EventHandler<UriChangedEventArgs> |
ParentChanged
Gets fired when the container of the current model element has changed
Declaration
event EventHandler<ValueChangedEventArgs> ParentChanged
Event Type
Type | Description |
---|---|
EventHandler<ValueChangedEventArgs> |