Class Model
Inherited Members
Namespace: NMF.Models
Assembly: NMF.Models.dll
Syntax
[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
Constructors
| Edit this page View SourceModel()
Declaration
public Model()
Properties
| Edit this page View SourceChildren
Gets the child model elements of this model element
Declaration
public override IEnumerableExpression<IModelElement> Children { get; }
Property Value
Type | Description |
---|---|
IEnumerableExpression<IModelElement> |
Overrides
| Edit this page View SourceClassInstance
Gets the Class model for this type
Declaration
public static IClass ClassInstance { get; }
Property Value
Type | Description |
---|---|
IClass |
FragmentPrefix
Gets or sets the prefix used for model fragments
Declaration
public static string FragmentPrefix { get; set; }
Property Value
Type | Description |
---|---|
string |
ModelUri
The ModelUri property
Declaration
public Uri ModelUri { get; set; }
Property Value
Type | Description |
---|---|
Uri |
PromoteSingleRootElement
This configuration sets whether a model should be identified with its single root model if such an element exists
Declaration
public static bool PromoteSingleRootElement { get; set; }
Property Value
Type | Description |
---|---|
bool |
ReferencedElements
Gets the referenced model elements of this model element
Declaration
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Type | Description |
---|---|
IEnumerableExpression<IModelElement> |
Overrides
| Edit this page View SourceRepository
The repository that manages this model
Declaration
public IModelRepository Repository { get; }
Property Value
Type | Description |
---|---|
IModelRepository |
RootElements
The RootElements property
Declaration
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IModelElement> RootElements { get; }
Property Value
Type | Description |
---|---|
IOrderedSetExpression<IModelElement> |
Methods
| Edit this page View SourceCreateUriForElement(IModelElement)
Declaration
public virtual Uri CreateUriForElement(IModelElement element)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | element |
Returns
Type | Description |
---|---|
Uri |
CreateUriWithFragment(string, bool, IModelElement)
Creates the uri with the given fragment starting from the current model element
Declaration
protected override Uri CreateUriWithFragment(string fragment, bool absolute, IModelElement baseElement = null)
Parameters
Type | Name | Description |
---|---|---|
string | fragment | The fragment starting from this element |
bool | absolute | True, if an absolute Uri is desired, otherwise false |
IModelElement | baseElement | The element from which the uri shall be created or null |
Returns
Type | Description |
---|---|
Uri | A uri (relative or absolute) |
Overrides
| Edit this page View SourceEnsureAllElementsContained()
Declaration
protected virtual void EnsureAllElementsContained()
GetAttributeValue(string, int)
Resolves the given attribute name
Declaration
protected override object GetAttributeValue(string attribute, int index)
Parameters
Type | Name | Description |
---|---|---|
string | attribute | The requested attribute name |
int | index | The index of this attribute |
Returns
Type | Description |
---|---|
object | The attribute value or null if it could not be found |
Overrides
| Edit this page View SourceGetClass()
Gets the Class for this model element
Declaration
public override IClass GetClass()
Returns
Type | Description |
---|---|
IClass |
Overrides
| Edit this page View SourceGetCollectionForFeature(string)
Gets the Model element collection for the given feature
Declaration
protected override IList GetCollectionForFeature(string feature)
Parameters
Type | Name | Description |
---|---|---|
string | feature | The requested feature |
Returns
Type | Description |
---|---|
IList | A non-generic list of elements |
Overrides
| Edit this page View SourceGetCompositionName(object)
Gets the property name for the given container
Declaration
protected override string GetCompositionName(object container)
Parameters
Type | Name | Description |
---|---|---|
object | container | The container object |
Returns
Type | Description |
---|---|
string | The name of the respective container reference |
Overrides
| Edit this page View SourceGetModelElementForReference(string, int)
Gets the Model element for the given reference and index
Declaration
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Type | Name | Description |
---|---|---|
string | reference | The reference name in upper case |
int | index | The index of the element within the reference |
Returns
Type | Description |
---|---|
IModelElement | The model element at the given reference |
Overrides
| Edit this page View SourceGetRelativePathForChild(IModelElement)
Gets the relative Uri for the given child element
Declaration
protected override string GetRelativePathForChild(IModelElement child)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | child | The child element |
Returns
Type | Description |
---|---|
string | A relative Uri to resolve the child element |
Overrides
| Edit this page View SourceGetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative Uri for the given child element that is not identified
Declaration
protected override string GetRelativePathForNonIdentifiedChild(IModelElement child)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | child | The child element |
Returns
Type | Description |
---|---|
string | A relative Uri to resolve the child element |
Overrides
| Edit this page View SourceOnBubbledChange(BubbledChangeEventArgs)
Fires the BubbledChange event
Declaration
protected override void OnBubbledChange(BubbledChangeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
BubbledChangeEventArgs | e | The event data |
Overrides
| Edit this page View SourceOnModelUriChanged(ValueChangedEventArgs)
Raises the ModelUriChanged event
Declaration
protected virtual void OnModelUriChanged(ValueChangedEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
ValueChangedEventArgs | eventArgs | The event data |
OnModelUriChanging(ValueChangedEventArgs)
Raises the ModelUriChanging event
Declaration
protected virtual void OnModelUriChanging(ValueChangedEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
ValueChangedEventArgs | eventArgs | The event data |
RegisterId(string, ModelElement)
Registers the given model element with the given id
Declaration
public bool RegisterId(string id, ModelElement element)
Parameters
Type | Name | Description |
---|---|---|
string | id | The identifier |
ModelElement | element | That element to register with the id |
Returns
Type | Description |
---|---|
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
Declaration
public override IModelElement Resolve(string relativeUri)
Parameters
Type | Name | Description |
---|---|---|
string | relativeUri | The path |
Returns
Type | Description |
---|---|
IModelElement | The element corresponding to the given path or null, if no such element could be found |
Overrides
| Edit this page View SourceResolveGlobal(string)
Resolves the given global ID
Declaration
public IModelElement ResolveGlobal(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The given global id |
Returns
Type | Description |
---|---|
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
Declaration
protected virtual bool SerializeAsReference(IModelElement element)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | element |
Returns
Type | Description |
---|---|
bool |
SetFeature(string, object)
Sets a value to the given feature
Declaration
protected override void SetFeature(string feature, object value)
Parameters
Type | Name | Description |
---|---|---|
string | feature | The requested feature |
object | value | The value that should be set to that feature |
Overrides
| Edit this page View SourceSimplifyUri(Uri)
Declaration
protected Uri SimplifyUri(Uri target)
Parameters
Type | Name | Description |
---|---|---|
Uri | target |
Returns
Type | Description |
---|---|
Uri |
UnregisterId(string)
Unregister the given identifier
Declaration
public bool UnregisterId(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The identifier |
Returns
Type | Description |
---|---|
bool | True, if the identifier is removed. False denotes that this identifier was not registered |
Events
| Edit this page View SourceModelUriChanged
Gets fired when the ModelUri property changed its value
Declaration
public event EventHandler<ValueChangedEventArgs> ModelUriChanged
Event Type
Type | Description |
---|---|
EventHandler<ValueChangedEventArgs> |
ModelUriChanging
Gets fired before the ModelUri property changes its value
Declaration
public event EventHandler<ValueChangedEventArgs> ModelUriChanging
Event Type
Type | Description |
---|---|
EventHandler<ValueChangedEventArgs> |
UnlockRequested
Raised when an unlock was requested for the model
Declaration
public event EventHandler<UnlockEventArgs> UnlockRequested
Event Type
Type | Description |
---|---|
EventHandler<UnlockEventArgs> |