mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Profile editor - Reimplemented more of the timeline
This commit is contained in:
1 parent
13a006ba48
commit
db9d9fb4e6
24 files changed
+294
-296
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Artemis.Core.LayerBrushes;
|
||||
using Artemis.Core.LayerEffects;
|
||||
@@ -672,6 +673,13 @@ namespace Artemis.Core
|
||||
if (descriptor == null)
|
||||
throw new ArgumentNullException(nameof(descriptor));
|
||||
|
||||
if (LayerBrush != null)
|
||||
{
|
||||
var brush = LayerBrush;
|
||||
LayerBrush = null;
|
||||
brush.Dispose();
|
||||
}
|
||||
|
||||
// Ensure the brush reference matches the brush
|
||||
var current = General.BrushReference.CurrentValue;
|
||||
if (current.BrushPluginGuid != descriptor.LayerBrushProvider.PluginInfo.Guid || current.BrushType != descriptor.LayerBrushType.Name)
|
||||
@@ -721,7 +729,7 @@ namespace Artemis.Core
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Event handlers
|
||||
|
||||
private void LayerBrushStoreOnLayerBrushRemoved(object sender, LayerBrushStoreEvent e)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Artemis.Core
|
||||
public abstract class LayerProperty<T> : ILayerProperty
|
||||
{
|
||||
private bool _disposed;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="LayerProperty{T}" /> class
|
||||
/// </summary>
|
||||
@@ -274,19 +274,6 @@ namespace Artemis.Core
|
||||
OnKeyframeRemoved();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all keyframes from the layer property
|
||||
/// </summary>
|
||||
public void ClearKeyframes()
|
||||
{
|
||||
if (_disposed)
|
||||
throw new ObjectDisposedException("LayerProperty");
|
||||
|
||||
var keyframes = new List<LayerPropertyKeyframe<T>>(_keyframes);
|
||||
foreach (var layerPropertyKeyframe in keyframes)
|
||||
RemoveKeyframe(layerPropertyKeyframe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the keyframes in ascending order by position
|
||||
/// </summary>
|
||||
@@ -343,6 +330,11 @@ namespace Artemis.Core
|
||||
return (DataBindingRegistration<T, TProperty>) match;
|
||||
}
|
||||
|
||||
public List<IDataBindingRegistration> GetAllDataBindingRegistrations()
|
||||
{
|
||||
return _dataBindingRegistrations;
|
||||
}
|
||||
|
||||
public void RegisterDataBindingProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda, DataBindingConverter<T, TProperty> converter)
|
||||
{
|
||||
if (_disposed)
|
||||
@@ -593,7 +585,7 @@ namespace Artemis.Core
|
||||
{
|
||||
_disposed = true;
|
||||
|
||||
foreach (var dataBinding in _dataBindings)
|
||||
foreach (var dataBinding in _dataBindings)
|
||||
dataBinding.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user