Class DataModelPath
Represents a path that points to a property in data model
public class DataModelPath : IStorageModel, IDisposable, IPluginFeatureDependent
- Inheritance
-
objectDataModelPath
- Implements
Constructors
DataModelPath(DataModelPath)
Creates a new instance of the DataModelPath class based on an existing path
public DataModelPath(DataModelPath dataModelPath)
Parameters
dataModelPathDataModelPathThe 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
targetDataModelThe 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
DataModelPath(DataModelPathEntity)
Creates a new instance of the DataModelPath class based on a Artemis.Storage.Entities.Profile.DataModelPathEntity
public DataModelPath(DataModelPathEntity entity)
Parameters
entityDataModelPathEntity
Properties
DataModelId
public string? DataModelId { get; }
Property Value
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
Path
Gets the point-separated path associated with this DataModelPath
public string Path { get; }
Property Value
Segments
Gets a read-only list of all segments of this path
public IReadOnlyCollection<DataModelPathSegment> Segments { get; }
Property Value
Target
Gets the data model at which this path starts
public DataModel? Target { get; }
Property Value
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
disposingbooltrue 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
PathValidated
Occurs whenever the path becomes valid
public event EventHandler? PathValidated