Class LayerPropertyPreview<T>
Represents a container for a preview value of a LayerProperty<T> that can be used to update and discard a temporary value.
Implements
Namespace: Artemis.Core
Assembly: Artemis.Core.dll
Syntax
public sealed class LayerPropertyPreview<T> : IDisposable
Type Parameters
Name | Description |
---|---|
T | The value type of the layer property. |
Constructors
LayerPropertyPreview(LayerProperty<T>, TimeSpan)
Creates a new instance of the LayerPropertyPreview<T> class.
Declaration
public LayerPropertyPreview(LayerProperty<T> layerProperty, TimeSpan time)
Parameters
Type | Name | Description |
---|---|---|
LayerProperty<T> | layerProperty | The layer property to apply the preview value to. |
TimeSpan | time | The time in the timeline at which the preview is applied. |
Properties
OriginalKeyframe
Gets the original keyframe of the property at the time the preview was created.
Declaration
public LayerPropertyKeyframe<T>? OriginalKeyframe { get; }
Property Value
Type | Description |
---|---|
LayerPropertyKeyframe<T> |
OriginalValue
Gets the original value of the property at the time the preview was created.
Declaration
public T OriginalValue { get; }
Property Value
Type | Description |
---|---|
T |
PreviewKeyframe
Gets the keyframe that was created to preview the value.
Declaration
public LayerPropertyKeyframe<T>? PreviewKeyframe { get; }
Property Value
Type | Description |
---|---|
LayerPropertyKeyframe<T> |
PreviewValue
Gets the preview value.
Declaration
public T? PreviewValue { get; }
Property Value
Type | Description |
---|---|
T |
Property
Gets the property this preview applies to.
Declaration
public LayerProperty<T> Property { get; }
Property Value
Type | Description |
---|---|
LayerProperty<T> |
Time
Gets the time in the timeline at which the preview is applied.
Declaration
public TimeSpan Time { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Methods
DiscardPreview()
Discard the preview value and restores the original state of the property. The returned boolean can be used to determine whether the preview value was different from the original value.
Declaration
public bool DiscardPreview()
Returns
Type | Description |
---|---|
bool |
Dispose()
Discard the preview value and restores the original state of the property. The returned boolean can be used to determine whether the preview value was different from the original value.
Declaration
public void Dispose()
Preview(T)
Updates the layer property to the given value
, keeping track of the original state of the
property.
Declaration
public void Preview(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to preview. |