Artemis Artemis
Artemis Artemis

Search Results for

    Class LayerProperty<T>

    Represents a property on a layer. Properties are saved in storage and can optionally be modified from the UI.

    Note: You cannot initialize layer properties yourself. If properly placed and annotated, the Artemis core will initialize these for you.

    Inheritance
    object
    CorePropertyChanged
    LayerProperty<T>
    BoolLayerProperty
    ColorGradientLayerProperty
    EnumLayerProperty<T>
    FloatLayerProperty
    FloatRangeLayerProperty
    IntLayerProperty
    IntRangeLayerProperty
    LayerBrushReferenceLayerProperty
    SKColorLayerProperty
    SKPointLayerProperty
    SKSizeLayerProperty
    Implements
    ILayerProperty
    IStorageModel
    IDisposable
    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public class LayerProperty<T> : CorePropertyChanged, ILayerProperty, IStorageModel, IDisposable
    Type Parameters
    Name Description
    T

    The type of property encapsulated in this layer property

    Constructors

    LayerProperty()

    Creates a new instance of the LayerProperty<T> class

    Declaration
    protected LayerProperty()

    Properties

    BaseDataBinding

    Declaration
    public IDataBinding BaseDataBinding { get; }
    Property Value
    Type Description
    IDataBinding

    BaseValue

    Gets or sets the base value of this layer property without any keyframes or data bindings applied

    Declaration
    public T BaseValue { get; set; }
    Property Value
    Type Description
    T

    CurrentKeyframe

    Gets the current keyframe in the timeline according to the current progress

    Declaration
    public LayerPropertyKeyframe<T>? CurrentKeyframe { get; protected set; }
    Property Value
    Type Description
    LayerPropertyKeyframe<T>

    CurrentValue

    Gets the current value of this property as it is affected by it's keyframes, updated once every frame

    Declaration
    public T CurrentValue { get; set; }
    Property Value
    Type Description
    T

    DataBinding

    Gets the data binding of this property

    Declaration
    public DataBinding<T> DataBinding { get; }
    Property Value
    Type Description
    DataBinding<T>

    DataBindingsSupported

    Declaration
    public bool DataBindingsSupported { get; }
    Property Value
    Type Description
    bool

    DefaultValue

    Gets or sets the default value of this layer property. If set, this value is automatically applied if the property has no value in storage

    Declaration
    public T DefaultValue { get; set; }
    Property Value
    Type Description
    T

    HasDataBinding

    Declaration
    public bool HasDataBinding { get; }
    Property Value
    Type Description
    bool

    IsHidden

    Declaration
    public bool IsHidden { get; set; }
    Property Value
    Type Description
    bool

    IsLoadedFromStorage

    Indicates whether the BaseValue was loaded from storage, useful to check whether a default value must be applied

    Declaration
    public bool IsLoadedFromStorage { get; }
    Property Value
    Type Description
    bool

    Keyframes

    Gets a read-only list of all the keyframes on this layer property

    Declaration
    public ReadOnlyCollection<LayerPropertyKeyframe<T>> Keyframes { get; }
    Property Value
    Type Description
    ReadOnlyCollection<LayerPropertyKeyframe<T>>

    KeyframesEnabled

    Gets or sets whether keyframes are enabled on this property, has no effect if KeyframesSupported is False

    Declaration
    public bool KeyframesEnabled { get; set; }
    Property Value
    Type Description
    bool

    KeyframesSupported

    Gets whether keyframes are supported on this type of property

    Declaration
    public bool KeyframesSupported { get; protected set; }
    Property Value
    Type Description
    bool

    LayerPropertyGroup

    Declaration
    public LayerPropertyGroup LayerPropertyGroup { get; }
    Property Value
    Type Description
    LayerPropertyGroup

    NextKeyframe

    Gets the next keyframe in the timeline according to the current progress

    Declaration
    public LayerPropertyKeyframe<T>? NextKeyframe { get; protected set; }
    Property Value
    Type Description
    LayerPropertyKeyframe<T>

    Path

    Declaration
    public string Path { get; }
    Property Value
    Type Description
    string

    ProfileElement

    Declaration
    public RenderProfileElement ProfileElement { get; }
    Property Value
    Type Description
    RenderProfileElement

    PropertyDescription

    Declaration
    public PropertyDescriptionAttribute PropertyDescription { get; }
    Property Value
    Type Description
    PropertyDescriptionAttribute

    PropertyType

    Declaration
    public Type PropertyType { get; }
    Property Value
    Type Description
    Type

    UntypedKeyframes

    Declaration
    public ReadOnlyCollection<ILayerPropertyKeyframe> UntypedKeyframes { get; }
    Property Value
    Type Description
    ReadOnlyCollection<ILayerPropertyKeyframe>

    Methods

    AddKeyframe(LayerPropertyKeyframe<T>)

    Adds a keyframe to the layer property

    Declaration
    public void AddKeyframe(LayerPropertyKeyframe<T> keyframe)
    Parameters
    Type Name Description
    LayerPropertyKeyframe<T> keyframe

    The keyframe to add

    AddUntypedKeyframe(ILayerPropertyKeyframe)

    Declaration
    public void AddUntypedKeyframe(ILayerPropertyKeyframe keyframe)
    Parameters
    Type Name Description
    ILayerPropertyKeyframe keyframe

    ApplyDefaultValue()

    Declaration
    public void ApplyDefaultValue()

    CreateKeyframeFromEntity(KeyframeEntity)

    Declaration
    public ILayerPropertyKeyframe? CreateKeyframeFromEntity(KeyframeEntity keyframeEntity)
    Parameters
    Type Name Description
    KeyframeEntity keyframeEntity
    Returns
    Type Description
    ILayerPropertyKeyframe

    Dispose()

    Declaration
    public void Dispose()

    Dispose(bool)

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

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

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

    Initialize(RenderProfileElement, LayerPropertyGroup, PropertyEntity, bool, PropertyDescriptionAttribute)

    Declaration
    public void Initialize(RenderProfileElement profileElement, LayerPropertyGroup group, PropertyEntity entity, bool fromStorage, PropertyDescriptionAttribute description)
    Parameters
    Type Name Description
    RenderProfileElement profileElement
    LayerPropertyGroup group
    PropertyEntity entity
    bool fromStorage
    PropertyDescriptionAttribute description

    IsHiddenWhen<TP>(TP, Func<TP, bool>)

    Set up a condition to hide the provided layer property when the condition evaluates to true

    Note: overrides previous calls to IsHiddenWhen and IsVisibleWhen

    Declaration
    public void IsHiddenWhen<TP>(TP layerProperty, Func<TP, bool> condition) where TP : ILayerProperty
    Parameters
    Type Name Description
    TP layerProperty

    The target layer property

    Func<TP, bool> condition

    The condition to evaluate to determine whether to hide the current layer property

    Type Parameters
    Name Description
    TP

    The type of the target layer property

    IsVisibleWhen<TP>(TP, Func<TP, bool>)

    Set up a condition to show the provided layer property when the condition evaluates to true

    Note: overrides previous calls to IsHiddenWhen and IsVisibleWhen

    Declaration
    public void IsVisibleWhen<TP>(TP layerProperty, Func<TP, bool> condition) where TP : ILayerProperty
    Parameters
    Type Name Description
    TP layerProperty

    The target layer property

    Func<TP, bool> condition

    The condition to evaluate to determine whether to hide the current layer property

    Type Parameters
    Name Description
    TP

    The type of the target layer property

    Load()

    Declaration
    public void Load()

    OnCurrentValueSet()

    Invokes the CurrentValueSet event

    Declaration
    protected virtual void OnCurrentValueSet()

    OnInitialize()

    Called when the layer property has been initialized

    Declaration
    protected virtual void OnInitialize()

    OnKeyframeAdded(ILayerPropertyKeyframe)

    Invokes the KeyframeAdded event

    Declaration
    protected virtual void OnKeyframeAdded(ILayerPropertyKeyframe keyframe)
    Parameters
    Type Name Description
    ILayerPropertyKeyframe keyframe

    OnKeyframeRemoved(ILayerPropertyKeyframe)

    Invokes the KeyframeRemoved event

    Declaration
    protected virtual void OnKeyframeRemoved(ILayerPropertyKeyframe keyframe)
    Parameters
    Type Name Description
    ILayerPropertyKeyframe keyframe

    OnKeyframesToggled()

    Invokes the KeyframesToggled event

    Declaration
    protected virtual void OnKeyframesToggled()

    OnUpdated()

    Invokes the Updated event

    Declaration
    protected virtual void OnUpdated()

    OnVisibilityChanged()

    Invokes the VisibilityChanged event

    Declaration
    protected virtual void OnVisibilityChanged()

    RemoveKeyframe(LayerPropertyKeyframe<T>)

    Removes a keyframe from the layer property

    Declaration
    public void RemoveKeyframe(LayerPropertyKeyframe<T> keyframe)
    Parameters
    Type Name Description
    LayerPropertyKeyframe<T> keyframe

    The keyframe to remove

    RemoveUntypedKeyframe(ILayerPropertyKeyframe)

    Declaration
    public void RemoveUntypedKeyframe(ILayerPropertyKeyframe keyframe)
    Parameters
    Type Name Description
    ILayerPropertyKeyframe keyframe

    Save()

    Saves the property to the underlying property entity

    Declaration
    public void Save()

    SetCurrentValue(T, TimeSpan?)

    Sets the current value, using either keyframes if enabled or the base value.

    Declaration
    public LayerPropertyKeyframe<T>? SetCurrentValue(T value, TimeSpan? time = null)
    Parameters
    Type Name Description
    T value

    The value to set.

    TimeSpan? time

    An optional time to set the value add, if provided and property is using keyframes the value will be set to an new or existing keyframe.

    Returns
    Type Description
    LayerPropertyKeyframe<T>

    The keyframe if one was created or updated.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Update(Timeline)

    Declaration
    public void Update(Timeline timeline)
    Parameters
    Type Name Description
    Timeline timeline

    UpdateCurrentValue(float, float)

    Called every update (if keyframes are both supported and enabled) to determine the new CurrentValue based on the provided progress

    Declaration
    protected virtual void UpdateCurrentValue(float keyframeProgress, float keyframeProgressEased)
    Parameters
    Type Name Description
    float keyframeProgress

    The linear current keyframe progress

    float keyframeProgressEased

    The current keyframe progress, eased with the current easing function

    UpdateDataBinding()

    Declaration
    public void UpdateDataBinding()

    Events

    CurrentValueSet

    Declaration
    public event EventHandler<LayerPropertyEventArgs>? CurrentValueSet
    Event Type
    Type Description
    EventHandler<LayerPropertyEventArgs>

    Disposed

    Declaration
    public event EventHandler? Disposed
    Event Type
    Type Description
    EventHandler

    KeyframeAdded

    Declaration
    public event EventHandler<LayerPropertyKeyframeEventArgs>? KeyframeAdded
    Event Type
    Type Description
    EventHandler<LayerPropertyKeyframeEventArgs>

    KeyframeRemoved

    Declaration
    public event EventHandler<LayerPropertyKeyframeEventArgs>? KeyframeRemoved
    Event Type
    Type Description
    EventHandler<LayerPropertyKeyframeEventArgs>

    KeyframesToggled

    Declaration
    public event EventHandler<LayerPropertyEventArgs>? KeyframesToggled
    Event Type
    Type Description
    EventHandler<LayerPropertyEventArgs>

    Updated

    Declaration
    public event EventHandler<LayerPropertyEventArgs>? Updated
    Event Type
    Type Description
    EventHandler<LayerPropertyEventArgs>

    VisibilityChanged

    Declaration
    public event EventHandler<LayerPropertyEventArgs>? VisibilityChanged
    Event Type
    Type Description
    EventHandler<LayerPropertyEventArgs>

    Implements

    ILayerProperty
    IStorageModel
    IDisposable
    Content is available under the PolyForm Noncommercial License, by Artemis RGB.