Class ModelExtensions
Denotes common extensions to model elements
Inherited Members
Namespace: NMF.Models
Assembly: NMF.Models.dll
Syntax
public static class ModelExtensions
Methods
| Edit this page View SourceAncestorTree(IModelElement)
Gets an incrementalizable collection with all ancestor elements
Declaration
public static IEnumerableExpression<ModelTreeItem> AncestorTree(this IModelElement element)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | element | The leaf element |
Returns
Type | Description |
---|---|
IEnumerableExpression<ModelTreeItem> | A collection including the element and all its ancestors |
Ancestors(IModelElement)
Gets an incrementalizable collection with all ancestor elements
Declaration
public static IEnumerableExpression<IModelElement> Ancestors(this IModelElement element)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | element | The leaf element |
Returns
Type | Description |
---|---|
IEnumerableExpression<IModelElement> | A collection including the element and all its ancestors |
Descendants(IModelElement)
Gets an incrementalizable collection with all descendent elements
Declaration
public static IEnumerableExpression<IModelElement> Descendants(this IModelElement element)
Parameters
Type | Name | Description |
---|---|---|
IModelElement | element | The root model element |
Returns
Type | Description |
---|---|
IEnumerableExpression<IModelElement> | An incrementalizable collection with all descendent elements |
Serialize(IModelSerializer, IModelElement, Stream, Uri)
Serializes the given model element to the given path
Declaration
public static void Serialize(this IModelSerializer serializer, IModelElement element, Stream target, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
IModelSerializer | serializer | The serializer |
IModelElement | element | The model element |
Stream | target | The target to which the model element should be serialized |
Uri | uri | The uri under which the element should be serialized |
Serialize(IModelSerializer, IModelElement, string)
Serializes the given model element to the given path
Declaration
public static void Serialize(this IModelSerializer serializer, IModelElement element, string path)
Parameters
Type | Name | Description |
---|---|---|
IModelSerializer | serializer | The serializer |
IModelElement | element | The model element |
string | path | The path |
Serialize(IModelSerializer, IModelElement, string, Uri)
Serializes the given model element to the given path
Declaration
public static void Serialize(this IModelSerializer serializer, IModelElement element, string path, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
IModelSerializer | serializer | The serializer |
IModelElement | element | The model element |
string | path | The path |
Uri | uri | The uri under which the element should be serialized |