Class Model
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
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
FragmentPrefix
Gets or sets the prefix used for model fragments
public static string FragmentPrefix { get; set; }
Property Value
ModelUri
The ModelUri property
public Uri ModelUri { get; set; }
Property Value
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
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Repository
The repository that manages this model
public IModelRepository Repository { get; }
Property Value
RootElements
The RootElements property
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IModelElement> RootElements { get; }
Property Value
Methods
CreateUriForElement(IModelElement)
public virtual Uri CreateUriForElement(IModelElement element)
Parameters
element
IModelElement
Returns
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
stringThe fragment starting from this element
absolute
boolTrue, if an absolute Uri is desired, otherwise false
baseElement
IModelElementThe 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
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
GetCollectionForFeature(string)
Gets the Model element collection for the given feature
protected override IList GetCollectionForFeature(string feature)
Parameters
feature
stringThe 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
objectThe 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
stringThe reference name in upper case
index
intThe 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
IModelElementThe 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
IModelElementThe 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
BubbledChangeEventArgsThe event data
OnModelUriChanged(ValueChangedEventArgs)
Raises the ModelUriChanged event
protected virtual void OnModelUriChanged(ValueChangedEventArgs eventArgs)
Parameters
eventArgs
ValueChangedEventArgsThe event data
OnModelUriChanging(ValueChangedEventArgs)
Raises the ModelUriChanging event
protected virtual void OnModelUriChanging(ValueChangedEventArgs eventArgs)
Parameters
eventArgs
ValueChangedEventArgsThe event data
RegisterId(string, ModelElement)
Registers the given model element with the given id
public bool RegisterId(string id, ModelElement element)
Parameters
id
stringThe identifier
element
ModelElementThat 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
stringThe 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
stringThe 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
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
SimplifyUri(Uri)
protected Uri SimplifyUri(Uri target)
Parameters
target
Uri
Returns
UnregisterId(string)
Unregister the given identifier
public bool UnregisterId(string id)
Parameters
id
stringThe 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
ModelUriChanging
Gets fired before the ModelUri property changes its value
public event EventHandler<ValueChangedEventArgs> ModelUriChanging
Event Type
UnlockRequested
Raised when an unlock was requested for the model
public event EventHandler<UnlockEventArgs> UnlockRequested