Table of Contents

Class DataModelPath

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents a path that points to a property in data model

public class DataModelPath : IStorageModel, IDisposable, IPluginFeatureDependent
Inheritance
object
DataModelPath
Implements

Constructors

DataModelPath(DataModelPath)

Creates a new instance of the DataModelPath class based on an existing path

public DataModelPath(DataModelPath dataModelPath)

Parameters

dataModelPath DataModelPath

The path to base the new instance on

DataModelPath(DataModel)

Creates a new instance of the DataModelPath class pointing directly to the target

public DataModelPath(DataModel target)

Parameters

target DataModel

The target at which this path starts

DataModelPath(DataModel, string)

Creates a new instance of the DataModelPath class pointing to the provided path

public DataModelPath(DataModel target, string path)

Parameters

target DataModel

The target at which this path starts

path string

A point-separated path

DataModelPath(DataModelPathEntity)

Creates a new instance of the DataModelPath class based on a Artemis.Storage.Entities.Profile.DataModelPathEntity

public DataModelPath(DataModelPathEntity entity)

Parameters

entity DataModelPathEntity

Properties

DataModelId

Gets the data model ID of the Target if it is a DataModel

public string? DataModelId { get; }

Property Value

string

Entity

Gets the entity used for persistent storage

public DataModelPathEntity Entity { get; }

Property Value

DataModelPathEntity

IsValid

Gets a boolean indicating whether all Segments are valid

public bool IsValid { get; }

Property Value

bool

Path

Gets the point-separated path associated with this DataModelPath

public string Path { get; }

Property Value

string

Segments

Gets a read-only list of all segments of this path

public IReadOnlyCollection<DataModelPathSegment> Segments { get; }

Property Value

IReadOnlyCollection<DataModelPathSegment>

Target

Gets the data model at which this path starts

public DataModel? Target { get; }

Property Value

DataModel

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetFeatureDependencies()

Gets the plugin features this class depends on, may contain the same plugin feature twice if depending on it in multiple ways.

public IEnumerable<PluginFeature> GetFeatureDependencies()

Returns

IEnumerable<PluginFeature>

A List<T> of PluginFeature this class depends on.

GetPropertyDescription()

Gets the property description of the property this path points to

public DataModelPropertyAttribute? GetPropertyDescription()

Returns

DataModelPropertyAttribute

If found, the data model property description

GetPropertyInfo()

Gets the property info of the property this path points to

public PropertyInfo? GetPropertyInfo()

Returns

PropertyInfo

If static, the property info. If dynamic, null

GetPropertyType()

Gets the type of the property this path points to

public Type? GetPropertyType()

Returns

Type

If possible, the property type

GetValue()

Gets the current value of the path

public object? GetValue()

Returns

object

Load()

Loads the model from its associated entity

public void Load()

OnPathInvalidated()

Invokes the PathValidated event

protected virtual void OnPathInvalidated()

OnPathValidated()

Invokes the PathInvalidated event

protected virtual void OnPathValidated()

Save()

Saves the model to its associated entity

public void Save()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Events

PathInvalidated

Occurs whenever the path becomes invalid

public event EventHandler? PathInvalidated

Event Type

EventHandler

PathValidated

Occurs whenever the path becomes valid

public event EventHandler? PathValidated

Event Type

EventHandler