Class NamedElementConstructorBase<TModel, TModelContract, TRuntime>
Base implementation of a named element information provider based on the .NET runtime.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Model.Runtime.Construction
Assembly: Kephas.Model.dll
Syntax
public abstract class NamedElementConstructorBase<TModel, TModelContract, TRuntime> : IRuntimeModelElementConstructor<TModel, TModelContract, TRuntime>, IRuntimeModelElementConstructor where TModel : NamedElementBase<TModelContract> where TModelContract : class, INamedElement where TRuntime : class
Type Parameters
Name | Description |
---|---|
TModel | Type of the model. |
TModelContract | Type of the model contract. |
TRuntime | Type of the runtime definition. |
Properties
| Improve this Doc View SourceElementNameDiscriminator
Gets the element name discriminator.
Declaration
protected virtual string ElementNameDiscriminator { get; }
Property Value
Type | Description |
---|---|
System.String | The element name discriminator. |
Remarks
This dicriminator can be used as a suffix in the name to identify the element type.
Methods
| Improve this Doc View SourceCanCreateModelElement(IModelConstructionContext, TRuntime)
Determines whether a model element can be created for the provided runtime element.
Declaration
protected virtual bool CanCreateModelElement(IModelConstructionContext constructionContext, TRuntime runtimeElement)
Parameters
Type | Name | Description |
---|---|---|
IModelConstructionContext | constructionContext | Context for the construction. |
TRuntime | runtimeElement | The runtime element. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ConstructModelElementContent(IModelConstructionContext, TRuntime, TModel)
Constructs the model element content.
Declaration
protected virtual void ConstructModelElementContent(IModelConstructionContext constructionContext, TRuntime runtimeElement, TModel element)
Parameters
Type | Name | Description |
---|---|---|
IModelConstructionContext | constructionContext | Context for the construction. |
TRuntime | runtimeElement | The runtime element. |
TModel | element | The element being constructed. |
TryComputeName(IModelConstructionContext, Object)
Tries to compute the name for the provided runtime element.
Declaration
public string TryComputeName(IModelConstructionContext constructionContext, object runtimeElement)
Parameters
Type | Name | Description |
---|---|---|
IModelConstructionContext | constructionContext | Context for the construction. |
System.Object | runtimeElement | The runtime element. |
Returns
Type | Description |
---|---|
System.String | A string containing the name, or |
TryComputeNameCore(Object)
Computes the model element name based on the runtime element.
Declaration
protected virtual string TryComputeNameCore(object runtimeElement)
Parameters
Type | Name | Description |
---|---|---|
System.Object | runtimeElement | The runtime element. |
Returns
Type | Description |
---|---|
System.String | The element name, or |
TryCreateModelElement(IModelConstructionContext, Object)
Tries to create an element information structure based on the provided runtime element information.
Declaration
public virtual INamedElement TryCreateModelElement(IModelConstructionContext constructionContext, object runtimeElement)
Parameters
Type | Name | Description |
---|---|---|
IModelConstructionContext | constructionContext | Context for the construction. |
System.Object | runtimeElement | The runtime element. |
Returns
Type | Description |
---|---|
INamedElement | A new element information based on the provided runtime element information, or |
TryCreateModelElementCore(IModelConstructionContext, TRuntime)
Core implementation of trying to get the element information.
Declaration
protected abstract TModel TryCreateModelElementCore(IModelConstructionContext constructionContext, TRuntime runtimeElement)
Parameters
Type | Name | Description |
---|---|---|
IModelConstructionContext | constructionContext | Context for the construction. |
TRuntime | runtimeElement | The runtime element. |
Returns
Type | Description |
---|---|
TModel | A new element information based on the provided runtime element information, or |