Interface IModelElement
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
Children
Gets the children of the current model element
IEnumerableExpression<IModelElement> Children { get; }
Property Value
ClassName
Gets the name of the class
string ClassName { get; }
Property Value
Extensions
Gets the extensions for the current model element
ICollectionExpression<ModelElementExtension> Extensions { get; }
Property Value
IdentifierString
Gets the string representation of the identifier
string IdentifierString { get; }
Property Value
IsFrozen
Determines whether the model elements and all elements underneath are frozen
bool IsFrozen { get; }
Property Value
IsIdentified
Gets a value indicating whether this item can be identified through its ToString value
bool IsIdentified { get; }
Property Value
IsLocked
Determines whether the model elements and all elements underneath are locked
bool IsLocked { get; }
Property Value
Model
Gets the model that contains the current model element
Model Model { get; }
Property Value
Parent
Gets the container of the current model element
IModelElement Parent { get; set; }
Property Value
ReferencedElements
Gets the model elements referenced by the current model element
IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
RelativeUri
Gets the relative Uri of this model element
Uri RelativeUri { get; }
Property Value
Methods
CallOperation(IOperation, params object[])
Calls the given operation
object CallOperation(IOperation operation, params object[] arguments)
Parameters
operation
IOperationThe 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
IAttributeThe attribute
index
intThe 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
IAttributeThe 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
IModelElementThe child element
index
intThe 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
IReferenceThe reference
index
intThe 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
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
stringA 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
UriA 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
IAttributeThe attribute
value
objectThe 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
IReferenceThe reference
element
IModelElementThe element that should be set
ToIdentifierString()
Gets an identification string of the model element
string ToIdentifierString()
Returns
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
Deleted
This event is fired after the model element is deleted
event EventHandler<UriChangedEventArgs> Deleted
Event Type
Deleting
This event is fired before the model element is deleted
event EventHandler<UriChangedEventArgs> Deleting
Event Type
ParentChanged
Gets fired when the container of the current model element has changed
event EventHandler<ValueChangedEventArgs> ParentChanged