mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-31 01:42:02 +00:00
Core - Flattened namespaces
Shared UI - Flattened namespaces Shared UI - General housekeeping Project - Code cleanup
This commit is contained in:
parent
029e39ec1d
commit
8718d01eae
29
src/Artemis.Core/Artemis.Core.csproj.DotSettings
Normal file
29
src/Artemis.Core/Artemis.Core.csproj.DotSettings
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=exceptions/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=extensions/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Ccolors/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Cconditions/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Cconditions_005Cabstract/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Cconditions_005Coperators/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Cdatabindings/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Cdatabindings_005Cmodifiers/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Clayerproperties/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Clayerproperties_005Cattributes/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Clayerproperties_005Ctypes/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Cprofile_005Clayershapes/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=models_005Csurface/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Cdatamodelexpansions_005Cattributes/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Cdatamodelexpansions_005Cinternal/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Clayerbrushes_005Cinternal/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Clayereffects_005Cinternal/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Cmodules_005Cactivationrequirements/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=plugins_005Csettings/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=rgb_002Enet/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cinterfaces/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cstorage/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cstorage_005Cinterfaces/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=utilities/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
|
|
||||||
namespace Artemis.Core
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
@ -15,6 +14,11 @@ namespace Artemis.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string ApplicationFolder = Path.GetDirectoryName(typeof(Constants).Assembly.Location);
|
public static readonly string ApplicationFolder = Path.GetDirectoryName(typeof(Constants).Assembly.Location);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The full path to the Artemis executable
|
||||||
|
/// </summary>
|
||||||
|
public static readonly string ExecutablePath = ApplicationUtilities.GetCurrentLocation();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The full path to the Artemis data folder
|
/// The full path to the Artemis data folder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Surface;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class SurfaceConfigurationEventArgs : EventArgs
|
public class SurfaceConfigurationEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class DeviceEventArgs : EventArgs
|
public class DeviceEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.RGB.NET;
|
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class FrameRenderedEventArgs : EventArgs
|
public class FrameRenderedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Artemis.Core.Plugins.Modules;
|
using Artemis.Core.Modules;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class FrameRenderingEventArgs : EventArgs
|
public class FrameRenderingEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class LayerPropertyEventArgs : EventArgs
|
public class LayerPropertyEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Events
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class PluginEventArgs : EventArgs
|
public class PluginEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Exceptions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents errors that occur withing the Artemis Core
|
||||||
|
/// </summary>
|
||||||
public class ArtemisCoreException : Exception
|
public class ArtemisCoreException : Exception
|
||||||
{
|
{
|
||||||
public ArtemisCoreException()
|
internal ArtemisCoreException(string message) : base(message)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtemisCoreException(string message) : base(message)
|
internal ArtemisCoreException(string message, Exception inner) : base(message, inner)
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArtemisCoreException(string message, Exception inner) : base(message, inner)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.Exceptions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ArtemisPluginException : Exception
|
public class ArtemisPluginException : Exception
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.Exceptions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ArtemisPluginLockException : Exception
|
public class ArtemisPluginLockException : Exception
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class DirectoryInfoExtensions
|
public static class DirectoryInfoExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class DoubleExtensions
|
public static class DoubleExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class FloatExtensions
|
public static class FloatExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class IEnumerableExtensions
|
public static class IEnumerableExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class ProcessExtensions
|
public static class ProcessExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class RgbDeviceExtensions
|
public static class RgbDeviceExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class RgbRectangleExtensions
|
public static class RgbRectangleExtensions
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
// ReSharper disable once InconsistentNaming - I didn't come up with SKColor
|
// ReSharper disable once InconsistentNaming - I didn't come up with SKColor
|
||||||
public static class SKColorExtensions
|
public static class SKColorExtensions
|
||||||
@ -29,7 +29,7 @@ namespace Artemis.Core.Extensions
|
|||||||
|
|
||||||
private static byte ClampToByte(float value)
|
private static byte ClampToByte(float value)
|
||||||
{
|
{
|
||||||
return (byte)Math.Clamp(value, 0, 255);
|
return (byte) Math.Clamp(value, 0, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Extensions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public static class TypeExtensions
|
public static class TypeExtensions
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ namespace Artemis.Core.Extensions
|
|||||||
|
|
||||||
// From https://stackoverflow.com/a/2224421/5015269 but inverted and renamed to match similar framework methods
|
// From https://stackoverflow.com/a/2224421/5015269 but inverted and renamed to match similar framework methods
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether an instance of a specified type can be casted to a variable of the current type
|
/// Determines whether an instance of a specified type can be casted to a variable of the current type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="to"></param>
|
/// <param name="to"></param>
|
||||||
/// <param name="from"></param>
|
/// <param name="from"></param>
|
||||||
|
|||||||
@ -4,7 +4,7 @@ using SkiaSharp;
|
|||||||
|
|
||||||
namespace Artemis.Core.JsonConverters
|
namespace Artemis.Core.JsonConverters
|
||||||
{
|
{
|
||||||
public class SKColorConverter : JsonConverter<SKColor>
|
internal class SKColorConverter : JsonConverter<SKColor>
|
||||||
{
|
{
|
||||||
public override void WriteJson(JsonWriter writer, SKColor value, JsonSerializer serializer)
|
public override void WriteJson(JsonWriter writer, SKColor value, JsonSerializer serializer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,11 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Artemis.Core.Annotations;
|
using Artemis.Core.Properties;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Colors
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A gradient containing a list of <see cref="ColorGradientStop" />s
|
/// A gradient containing a list of <see cref="ColorGradientStop" />s
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Artemis.Core.Annotations;
|
using Artemis.Core.Properties;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Colors
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A color with a position, usually contained in a <see cref="ColorGradient" />
|
/// A color with a position, usually contained in a <see cref="ColorGradient" />
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Artemis.Core.Services.Interfaces;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Abstract
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An abstract class for display condition parts
|
/// An abstract class for display condition parts
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Models.Profile.Conditions.Abstract;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using Artemis.Storage.Entities.Profile.Conditions;
|
using Artemis.Storage.Entities.Profile.Conditions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A group containing zero to many <see cref="DisplayConditionPart" />s which it evaluates using a boolean specific
|
/// A group containing zero to many <see cref="DisplayConditionPart" />s which it evaluates using a boolean specific
|
||||||
|
|||||||
@ -2,15 +2,12 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.DataModelExpansions;
|
||||||
using Artemis.Core.Models.Profile.Conditions.Abstract;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using Artemis.Storage.Entities.Profile.Conditions;
|
using Artemis.Storage.Entities.Profile.Conditions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class DisplayConditionList : DisplayConditionPart
|
public class DisplayConditionList : DisplayConditionPart
|
||||||
{
|
{
|
||||||
@ -33,6 +30,8 @@ namespace Artemis.Core.Models.Profile.Conditions
|
|||||||
public DataModel ListDataModel { get; private set; }
|
public DataModel ListDataModel { get; private set; }
|
||||||
public string ListPropertyPath { get; private set; }
|
public string ListPropertyPath { get; private set; }
|
||||||
|
|
||||||
|
public Func<object, IList> CompiledListAccessor { get; set; }
|
||||||
|
|
||||||
public override bool Evaluate()
|
public override bool Evaluate()
|
||||||
{
|
{
|
||||||
if (CompiledListAccessor == null)
|
if (CompiledListAccessor == null)
|
||||||
@ -59,6 +58,47 @@ namespace Artemis.Core.Models.Profile.Conditions
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateList(DataModel dataModel, string path)
|
||||||
|
{
|
||||||
|
if (dataModel != null && path == null)
|
||||||
|
throw new ArtemisCoreException("If a data model is provided, a path is also required");
|
||||||
|
if (dataModel == null && path != null)
|
||||||
|
throw new ArtemisCoreException("If path is provided, a data model is also required");
|
||||||
|
|
||||||
|
if (dataModel != null)
|
||||||
|
{
|
||||||
|
if (!dataModel.ContainsPath(path))
|
||||||
|
throw new ArtemisCoreException($"Data model of type {dataModel.GetType().Name} does not contain a property at path '{path}'");
|
||||||
|
if (dataModel.GetListTypeAtPath(path) == null)
|
||||||
|
throw new ArtemisCoreException($"The path '{path}' does not contain a list");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the old root group that was tied to the old data model
|
||||||
|
while (Children.Any())
|
||||||
|
RemoveChild(Children[0]);
|
||||||
|
|
||||||
|
ListDataModel = dataModel;
|
||||||
|
ListPropertyPath = path;
|
||||||
|
|
||||||
|
if (dataModel == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Create a new root group
|
||||||
|
AddChild(new DisplayConditionGroup(this));
|
||||||
|
CreateExpression();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateExpression()
|
||||||
|
{
|
||||||
|
var parameter = Expression.Parameter(typeof(object), "listDataModel");
|
||||||
|
var accessor = ListPropertyPath.Split('.').Aggregate<string, Expression>(
|
||||||
|
Expression.Convert(parameter, ListDataModel.GetType()),
|
||||||
|
(expression, s) => Expression.Convert(Expression.Property(expression, s), typeof(IList)));
|
||||||
|
|
||||||
|
var lambda = Expression.Lambda<Func<object, IList>>(accessor, parameter);
|
||||||
|
CompiledListAccessor = lambda.Compile();
|
||||||
|
}
|
||||||
|
|
||||||
internal override void ApplyToEntity()
|
internal override void ApplyToEntity()
|
||||||
{
|
{
|
||||||
// Target list
|
// Target list
|
||||||
@ -103,51 +143,9 @@ namespace Artemis.Core.Models.Profile.Conditions
|
|||||||
Entity.Children.Clear();
|
Entity.Children.Clear();
|
||||||
AddChild(new DisplayConditionGroup(this));
|
AddChild(new DisplayConditionGroup(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
Children[0].Initialize(dataModelService);
|
Children[0].Initialize(dataModelService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateList(DataModel dataModel, string path)
|
|
||||||
{
|
|
||||||
if (dataModel != null && path == null)
|
|
||||||
throw new ArtemisCoreException("If a data model is provided, a path is also required");
|
|
||||||
if (dataModel == null && path != null)
|
|
||||||
throw new ArtemisCoreException("If path is provided, a data model is also required");
|
|
||||||
|
|
||||||
if (dataModel != null)
|
|
||||||
{
|
|
||||||
if (!dataModel.ContainsPath(path))
|
|
||||||
throw new ArtemisCoreException($"Data model of type {dataModel.GetType().Name} does not contain a property at path '{path}'");
|
|
||||||
if (dataModel.GetListTypeAtPath(path) == null)
|
|
||||||
throw new ArtemisCoreException($"The path '{path}' does not contain a list");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the old root group that was tied to the old data model
|
|
||||||
while (Children.Any())
|
|
||||||
RemoveChild(Children[0]);
|
|
||||||
|
|
||||||
ListDataModel = dataModel;
|
|
||||||
ListPropertyPath = path;
|
|
||||||
|
|
||||||
if (dataModel == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Create a new root group
|
|
||||||
AddChild(new DisplayConditionGroup(this));
|
|
||||||
CreateExpression();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CreateExpression()
|
|
||||||
{
|
|
||||||
var parameter = Expression.Parameter(typeof(object), "listDataModel");
|
|
||||||
var accessor = ListPropertyPath.Split('.').Aggregate<string, Expression>(
|
|
||||||
Expression.Convert(parameter, ListDataModel.GetType()),
|
|
||||||
(expression, s) => Expression.Convert(Expression.Property(expression, s), typeof(IList)));
|
|
||||||
|
|
||||||
var lambda = Expression.Lambda<Func<object, IList>>(accessor, parameter);
|
|
||||||
CompiledListAccessor = lambda.Compile();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Func<object, IList> CompiledListAccessor { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ListOperator
|
public enum ListOperator
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.DataModelExpansions;
|
||||||
using Artemis.Core.Extensions;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Models.Profile.Conditions.Abstract;
|
|
||||||
using Artemis.Core.Plugins.DataModelExpansions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using Artemis.Storage.Entities.Profile.Conditions;
|
using Artemis.Storage.Entities.Profile.Conditions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class DisplayConditionListPredicate : DisplayConditionPart
|
public class DisplayConditionListPredicate : DisplayConditionPart
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Extensions;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A display condition operator is used by the conditions system to perform a specific boolean check
|
/// A display condition operator is used by the conditions system to perform a specific boolean check
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.DataModelExpansions;
|
||||||
using Artemis.Core.Extensions;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Models.Profile.Conditions.Abstract;
|
|
||||||
using Artemis.Core.Plugins.DataModelExpansions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using Artemis.Storage.Entities.Profile.Conditions;
|
using Artemis.Storage.Entities.Profile.Conditions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A predicate in a display condition using either two data model values or one data model value and a
|
/// A predicate in a display condition using either two data model values or one data model value and a
|
||||||
@ -198,8 +195,10 @@ namespace Artemis.Core.Models.Profile.Conditions
|
|||||||
|
|
||||||
var leftType = LeftDataModel.GetTypeAtPath(LeftPropertyPath);
|
var leftType = LeftDataModel.GetTypeAtPath(LeftPropertyPath);
|
||||||
if (!displayConditionOperator.SupportsType(leftType))
|
if (!displayConditionOperator.SupportsType(leftType))
|
||||||
|
{
|
||||||
throw new ArtemisCoreException($"Cannot apply operator {displayConditionOperator.GetType().Name} to this predicate because " +
|
throw new ArtemisCoreException($"Cannot apply operator {displayConditionOperator.GetType().Name} to this predicate because " +
|
||||||
$"it does not support left side type {leftType.Name}");
|
$"it does not support left side type {leftType.Name}");
|
||||||
|
}
|
||||||
|
|
||||||
Operator = displayConditionOperator;
|
Operator = displayConditionOperator;
|
||||||
CreateExpression();
|
CreateExpression();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class EqualsConditionOperator : DisplayConditionOperator
|
internal class EqualsConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class GreaterThanConditionOperator : DisplayConditionOperator
|
internal class GreaterThanConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class GreaterThanOrEqualConditionOperator : DisplayConditionOperator
|
internal class GreaterThanOrEqualConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class LessThanConditionOperator : DisplayConditionOperator
|
internal class LessThanConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class LessThanOrEqualConditionOperator : DisplayConditionOperator
|
internal class LessThanOrEqualConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class NotEqualConditionOperator : DisplayConditionOperator
|
internal class NotEqualConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> { typeof(object) };
|
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(object)};
|
||||||
|
|
||||||
public override string Description => "Does not equal";
|
public override string Description => "Does not equal";
|
||||||
public override string Icon => "NotEqualVariant";
|
public override string Icon => "NotEqualVariant";
|
||||||
|
|||||||
@ -3,17 +3,17 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringContainsConditionOperator : DisplayConditionOperator
|
internal class StringContainsConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
private readonly MethodInfo _toLower;
|
|
||||||
private readonly MethodInfo _contains;
|
private readonly MethodInfo _contains;
|
||||||
|
private readonly MethodInfo _toLower;
|
||||||
|
|
||||||
public StringContainsConditionOperator()
|
public StringContainsConditionOperator()
|
||||||
{
|
{
|
||||||
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
||||||
_contains = typeof(string).GetMethod("Contains", new[] {typeof(string) });
|
_contains = typeof(string).GetMethod("Contains", new[] {typeof(string)});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(string)};
|
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(string)};
|
||||||
|
|||||||
@ -3,20 +3,20 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringEndsWithConditionOperator : DisplayConditionOperator
|
internal class StringEndsWithConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
private readonly MethodInfo _toLower;
|
|
||||||
private readonly MethodInfo _endsWith;
|
private readonly MethodInfo _endsWith;
|
||||||
|
private readonly MethodInfo _toLower;
|
||||||
|
|
||||||
public StringEndsWithConditionOperator()
|
public StringEndsWithConditionOperator()
|
||||||
{
|
{
|
||||||
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
||||||
_endsWith = typeof(string).GetMethod("EndsWith", new[] { typeof(string) });
|
_endsWith = typeof(string).GetMethod("EndsWith", new[] {typeof(string)});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> { typeof(string) };
|
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(string)};
|
||||||
|
|
||||||
public override string Description => "Ends with";
|
public override string Description => "Ends with";
|
||||||
public override string Icon => "ContainEnd";
|
public override string Icon => "ContainEnd";
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringEqualsConditionOperator : DisplayConditionOperator
|
internal class StringEqualsConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,20 +3,20 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringNotContainsConditionOperator : DisplayConditionOperator
|
internal class StringNotContainsConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
private readonly MethodInfo _toLower;
|
|
||||||
private readonly MethodInfo _contains;
|
private readonly MethodInfo _contains;
|
||||||
|
private readonly MethodInfo _toLower;
|
||||||
|
|
||||||
public StringNotContainsConditionOperator()
|
public StringNotContainsConditionOperator()
|
||||||
{
|
{
|
||||||
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
||||||
_contains = typeof(string).GetMethod("Contains", new[] { typeof(string) });
|
_contains = typeof(string).GetMethod("Contains", new[] {typeof(string)});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> { typeof(string) };
|
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(string)};
|
||||||
|
|
||||||
public override string Description => "Does not contain";
|
public override string Description => "Does not contain";
|
||||||
public override string Icon => "FormatStrikethrough";
|
public override string Icon => "FormatStrikethrough";
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringNotEqualConditionOperator : DisplayConditionOperator
|
internal class StringNotEqualConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringNullConditionOperator : DisplayConditionOperator
|
internal class StringNullConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,20 +3,20 @@ using System.Collections.Generic;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.Conditions.Operators
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
internal class StringStartsWithConditionOperator : DisplayConditionOperator
|
internal class StringStartsWithConditionOperator : DisplayConditionOperator
|
||||||
{
|
{
|
||||||
private readonly MethodInfo _toLower;
|
|
||||||
private readonly MethodInfo _startsWith;
|
private readonly MethodInfo _startsWith;
|
||||||
|
private readonly MethodInfo _toLower;
|
||||||
|
|
||||||
public StringStartsWithConditionOperator()
|
public StringStartsWithConditionOperator()
|
||||||
{
|
{
|
||||||
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
_toLower = typeof(string).GetMethod("ToLower", new Type[] { });
|
||||||
_startsWith = typeof(string).GetMethod("StartsWith", new[] { typeof(string) });
|
_startsWith = typeof(string).GetMethod("StartsWith", new[] {typeof(string)});
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> { typeof(string) };
|
public override IReadOnlyCollection<Type> CompatibleTypes => new List<Type> {typeof(string)};
|
||||||
|
|
||||||
public override string Description => "Starts with";
|
public override string Description => "Starts with";
|
||||||
public override string Icon => "ContainStart";
|
public override string Icon => "ContainStart";
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties;
|
using Artemis.Core.DataModelExpansions;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.DataBindings
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A data binding that binds a certain <see cref="BaseLayerProperty" /> to a value inside a <see cref="DataModel" />
|
/// A data binding that binds a certain <see cref="BaseLayerProperty" /> to a value inside a <see cref="DataModel" />
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.DataModelExpansions;
|
||||||
using Artemis.Core.Models.Profile.DataBindings.Modifiers;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile.DataBindings;
|
using Artemis.Storage.Entities.Profile.DataBindings;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.DataBindings
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Modifies a data model value in a way defined by the modifier type
|
/// Modifies a data model value in a way defined by the modifier type
|
||||||
|
|||||||
@ -2,20 +2,17 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Extensions;
|
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
using Artemis.Core.Services;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.DataBindings.Modifiers
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A modifier that changes the source value of a data binding in some way
|
/// A modifier that changes the source value of a data binding in some way
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DataBindingModifierType
|
public abstract class DataBindingModifierType
|
||||||
{
|
{
|
||||||
private bool _registered;
|
|
||||||
private IDataBindingService _dataBindingService;
|
private IDataBindingService _dataBindingService;
|
||||||
|
private bool _registered;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the plugin info this data binding modifier belongs to
|
/// Gets the plugin info this data binding modifier belongs to
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Plugins.LayerEffects;
|
using Artemis.Core.LayerEffects;
|
||||||
using Artemis.Core.Utilities;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public sealed class Folder : RenderProfileElement
|
public sealed class Folder : RenderProfileElement
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,21 +2,14 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Extensions;
|
using Artemis.Core.LayerBrushes;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties;
|
using Artemis.Core.LayerEffects;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
|
||||||
using Artemis.Core.Models.Profile.LayerShapes;
|
|
||||||
using Artemis.Core.Models.Surface;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
using Artemis.Core.Plugins.LayerEffects;
|
|
||||||
using Artemis.Core.Services;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a layer on a profile. To create new layers use the <see cref="RenderElementService" /> by injecting
|
/// Represents a layer on a profile. To create new layers use the <see cref="RenderElementService" /> by injecting
|
||||||
@ -232,10 +225,10 @@ namespace Artemis.Core.Models.Profile
|
|||||||
switch (General.ShapeType.CurrentValue)
|
switch (General.ShapeType.CurrentValue)
|
||||||
{
|
{
|
||||||
case LayerShapeType.Ellipse:
|
case LayerShapeType.Ellipse:
|
||||||
LayerShape = new Ellipse(this);
|
LayerShape = new EllipseShape(this);
|
||||||
break;
|
break;
|
||||||
case LayerShapeType.Rectangle:
|
case LayerShapeType.Rectangle:
|
||||||
LayerShape = new Rectangle(this);
|
LayerShape = new RectangleShape(this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
@ -291,9 +284,7 @@ namespace Artemis.Core.Models.Profile
|
|||||||
if (stickToMainSegment)
|
if (stickToMainSegment)
|
||||||
{
|
{
|
||||||
if (!DisplayContinuously)
|
if (!DisplayContinuously)
|
||||||
{
|
|
||||||
TimelinePosition = StartSegmentLength + timeOverride;
|
TimelinePosition = StartSegmentLength + timeOverride;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var progress = timeOverride.TotalMilliseconds % MainSegmentLength.TotalMilliseconds;
|
var progress = timeOverride.TotalMilliseconds % MainSegmentLength.TotalMilliseconds;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Plugins.LayerBrushes;
|
using Artemis.Core.LayerBrushes;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference to a <see cref="LayerBrushDescriptor" />
|
/// A reference to a <see cref="LayerBrushDescriptor" />
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
using SkiaSharp;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties.Types;
|
|
||||||
using SkiaSharp;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class LayerGeneralProperties : LayerPropertyGroup
|
public class LayerGeneralProperties : LayerPropertyGroup
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Attributes
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class PropertyDescriptionAttribute : Attribute
|
public class PropertyDescriptionAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Attributes
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class PropertyGroupDescriptionAttribute : Attribute
|
public class PropertyGroupDescriptionAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.Events;
|
|
||||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, to implement your own layer property type, extend <see cref="LayerProperty{T}" /> instead.
|
/// For internal use only, to implement your own layer property type, extend <see cref="LayerProperty{T}" /> instead.
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Utilities;
|
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, use <see cref="LayerPropertyKeyframe{T}" /> instead.
|
/// For internal use only, use <see cref="LayerPropertyKeyframe{T}" /> instead.
|
||||||
|
|||||||
@ -3,12 +3,10 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.Exceptions;
|
|
||||||
using Artemis.Core.Utilities;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a property on a layer. Properties are saved in storage and can optionally be modified from the UI.
|
/// Represents a property on a layer. Properties are saved in storage and can optionally be modified from the UI.
|
||||||
@ -175,7 +173,10 @@ namespace Artemis.Core.Models.Profile.LayerProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override Type GetPropertyType() => typeof(T);
|
public override Type GetPropertyType()
|
||||||
|
{
|
||||||
|
return typeof(T);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override List<PropertyInfo> GetDataBindingProperties()
|
public override List<PropertyInfo> GetDataBindingProperties()
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Utilities;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class LayerPropertyKeyframe<T> : BaseLayerPropertyKeyframe
|
public class LayerPropertyKeyframe<T> : BaseLayerPropertyKeyframe
|
||||||
{
|
{
|
||||||
|
private LayerProperty<T> _layerProperty;
|
||||||
private TimeSpan _position;
|
private TimeSpan _position;
|
||||||
private T _value;
|
private T _value;
|
||||||
private LayerProperty<T> _layerProperty;
|
|
||||||
|
|
||||||
public LayerPropertyKeyframe(T value, TimeSpan position, Easings.Functions easingFunction, LayerProperty<T> layerProperty) : base(layerProperty)
|
public LayerPropertyKeyframe(T value, TimeSpan position, Easings.Functions easingFunction, LayerProperty<T> layerProperty) : base(layerProperty)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
using Artemis.Core.Exceptions;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using Artemis.Core.Models.Profile.Colors;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class ColorGradientLayerProperty : LayerProperty<ColorGradient>
|
public class ColorGradientLayerProperty : LayerProperty<ColorGradient>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Exceptions;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class EnumLayerProperty<T> : LayerProperty<T> where T : Enum
|
public class EnumLayerProperty<T> : LayerProperty<T> where T : Enum
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class FloatLayerProperty : LayerProperty<float>
|
public class FloatLayerProperty : LayerProperty<float>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class IntLayerProperty : LayerProperty<int>
|
public class IntLayerProperty : LayerProperty<int>
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
using Artemis.Core.Exceptions;
|
namespace Artemis.Core
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A special layer property used to configure the selected layer brush
|
/// A special layer property used to configure the selected layer brush
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Extensions;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class SKColorLayerProperty : LayerProperty<SKColor>
|
public class SKColorLayerProperty : LayerProperty<SKColor>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class SKPointLayerProperty : LayerProperty<SKPoint>
|
public class SKPointLayerProperty : LayerProperty<SKPoint>
|
||||||
|
|||||||
@ -3,7 +3,7 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class SKSizeLayerProperty : LayerProperty<SKSize>
|
public class SKSizeLayerProperty : LayerProperty<SKSize>
|
||||||
@ -17,16 +17,16 @@ namespace Artemis.Core.Models.Profile.LayerProperties.Types
|
|||||||
return p.CurrentValue;
|
return p.CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override List<PropertyInfo> GetDataBindingProperties()
|
||||||
|
{
|
||||||
|
return typeof(SKSize).GetProperties().Where(p => p.CanWrite).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void UpdateCurrentValue(float keyframeProgress, float keyframeProgressEased)
|
protected override void UpdateCurrentValue(float keyframeProgress, float keyframeProgressEased)
|
||||||
{
|
{
|
||||||
var widthDiff = NextKeyframe.Value.Width - CurrentKeyframe.Value.Width;
|
var widthDiff = NextKeyframe.Value.Width - CurrentKeyframe.Value.Width;
|
||||||
var heightDiff = NextKeyframe.Value.Height - CurrentKeyframe.Value.Height;
|
var heightDiff = NextKeyframe.Value.Height - CurrentKeyframe.Value.Height;
|
||||||
CurrentValue = new SKSize(CurrentKeyframe.Value.Width + widthDiff * keyframeProgressEased, CurrentKeyframe.Value.Height + heightDiff * keyframeProgressEased);
|
CurrentValue = new SKSize(CurrentKeyframe.Value.Width + widthDiff * keyframeProgressEased, CurrentKeyframe.Value.Height + heightDiff * keyframeProgressEased);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<PropertyInfo> GetDataBindingProperties()
|
|
||||||
{
|
|
||||||
return typeof(SKSize).GetProperties().Where(p => p.CanWrite).ToList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,19 +2,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Annotations;
|
using Artemis.Core.LayerBrushes;
|
||||||
using Artemis.Core.Events;
|
using Artemis.Core.LayerEffects;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.Properties;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
using Artemis.Core.Plugins.LayerEffects;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public abstract class LayerPropertyGroup : IDisposable
|
public abstract class LayerPropertyGroup : IDisposable
|
||||||
{
|
{
|
||||||
@ -89,6 +83,13 @@ namespace Artemis.Core.Models.Profile
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ReadOnlyCollection<LayerPropertyGroup> LayerPropertyGroups => _layerPropertyGroups.AsReadOnly();
|
public ReadOnlyCollection<LayerPropertyGroup> LayerPropertyGroups => _layerPropertyGroups.AsReadOnly();
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
DisableProperties();
|
||||||
|
foreach (var layerPropertyGroup in _layerPropertyGroups)
|
||||||
|
layerPropertyGroup.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Recursively gets all layer properties on this group and any subgroups
|
/// Recursively gets all layer properties on this group and any subgroups
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -108,13 +109,6 @@ namespace Artemis.Core.Models.Profile
|
|||||||
return _allLayerProperties;
|
return _allLayerProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
DisableProperties();
|
|
||||||
foreach (var layerPropertyGroup in _layerPropertyGroups)
|
|
||||||
layerPropertyGroup.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called before property group is activated to allow you to populate <see cref="LayerProperty{T}.DefaultValue" /> on
|
/// Called before property group is activated to allow you to populate <see cref="LayerProperty{T}.DefaultValue" /> on
|
||||||
/// the properties you want
|
/// the properties you want
|
||||||
|
|||||||
@ -1,13 +1,17 @@
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerShapes
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class Ellipse : LayerShape
|
/// <summary>
|
||||||
|
/// Represents an ellipse layer shape
|
||||||
|
/// </summary>
|
||||||
|
public class EllipseShape : LayerShape
|
||||||
{
|
{
|
||||||
public Ellipse(Layer layer) : base(layer)
|
internal EllipseShape(Layer layer) : base(layer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public override void CalculateRenderProperties()
|
public override void CalculateRenderProperties()
|
||||||
{
|
{
|
||||||
var path = new SKPath();
|
var path = new SKPath();
|
||||||
@ -1,10 +1,13 @@
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerShapes
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the shape of a layer
|
||||||
|
/// </summary>
|
||||||
public abstract class LayerShape
|
public abstract class LayerShape
|
||||||
{
|
{
|
||||||
protected LayerShape(Layer layer)
|
internal LayerShape(Layer layer)
|
||||||
{
|
{
|
||||||
Layer = layer;
|
Layer = layer;
|
||||||
}
|
}
|
||||||
@ -19,6 +22,9 @@ namespace Artemis.Core.Models.Profile.LayerShapes
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SKPath Path { get; protected set; }
|
public SKPath Path { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the <see cref="Path" />
|
||||||
|
/// </summary>
|
||||||
public abstract void CalculateRenderProperties();
|
public abstract void CalculateRenderProperties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,13 +1,17 @@
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile.LayerShapes
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class Rectangle : LayerShape
|
/// <summary>
|
||||||
|
/// Represents a rectangular layer shape
|
||||||
|
/// </summary>
|
||||||
|
public class RectangleShape : LayerShape
|
||||||
{
|
{
|
||||||
public Rectangle(Layer layer) : base(layer)
|
internal RectangleShape(Layer layer) : base(layer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
public override void CalculateRenderProperties()
|
public override void CalculateRenderProperties()
|
||||||
{
|
{
|
||||||
var path = new SKPath();
|
var path = new SKPath();
|
||||||
@ -1,8 +1,6 @@
|
|||||||
using Artemis.Core.Models.Profile.LayerProperties.Attributes;
|
using SkiaSharp;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties.Types;
|
|
||||||
using SkiaSharp;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class LayerTransformProperties : LayerPropertyGroup
|
public class LayerTransformProperties : LayerPropertyGroup
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.Modules;
|
||||||
using Artemis.Core.Models.Surface;
|
|
||||||
using Artemis.Core.Plugins.Modules;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public sealed class Profile : ProfileElement
|
public sealed class Profile : ProfileElement
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Plugins.Modules;
|
using Artemis.Core.Modules;
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ProfileDescriptor
|
public class ProfileDescriptor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,23 +5,10 @@ using System.Linq;
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public abstract class ProfileElement : PropertyChangedBase, IDisposable
|
public abstract class ProfileElement : PropertyChangedBase, IDisposable
|
||||||
{
|
{
|
||||||
protected virtual void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Dispose(true);
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected bool _disposed;
|
protected bool _disposed;
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
private Guid _entityId;
|
private Guid _entityId;
|
||||||
@ -86,6 +73,12 @@ namespace Artemis.Core.Models.Profile
|
|||||||
set => SetAndNotify(ref _enabled, value);
|
set => SetAndNotify(ref _enabled, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the element
|
/// Updates the element
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -201,6 +194,13 @@ namespace Artemis.Core.Models.Profile
|
|||||||
return $"{nameof(EntityId)}: {EntityId}, {nameof(Order)}: {Order}, {nameof(Name)}: {Name}";
|
return $"{nameof(EntityId)}: {EntityId}, {nameof(Order)}: {Order}, {nameof(Name)}: {Name}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Applies the profile element's properties to the underlying storage entity
|
/// Applies the profile element's properties to the underlying storage entity
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An enum defining the right side type of a profile entity
|
/// An enum defining the right side type of a profile entity
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
namespace Artemis.Core
|
||||||
using Artemis.Storage.Entities.Profile;
|
|
||||||
using SkiaSharp;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
|
||||||
{
|
{
|
||||||
public abstract class PropertiesProfileElement : ProfileElement
|
public abstract class PropertiesProfileElement : ProfileElement
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,18 +2,31 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Annotations;
|
using Artemis.Core.LayerEffects;
|
||||||
using Artemis.Core.Models.Profile.Conditions;
|
using Artemis.Core.Properties;
|
||||||
using Artemis.Core.Models.Profile.LayerProperties;
|
|
||||||
using Artemis.Core.Plugins.LayerEffects;
|
|
||||||
using Artemis.Storage.Entities.Profile;
|
using Artemis.Storage.Entities.Profile;
|
||||||
using Artemis.Storage.Entities.Profile.Abstract;
|
using Artemis.Storage.Entities.Profile.Abstract;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Profile
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public abstract class RenderProfileElement : ProfileElement
|
public abstract class RenderProfileElement : ProfileElement
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all keyframes on all properties and effects of this layer
|
||||||
|
/// </summary>
|
||||||
|
public virtual List<BaseLayerPropertyKeyframe> GetAllKeyframes()
|
||||||
|
{
|
||||||
|
var keyframes = new List<BaseLayerPropertyKeyframe>();
|
||||||
|
foreach (var layerEffect in LayerEffects)
|
||||||
|
{
|
||||||
|
foreach (var baseLayerProperty in layerEffect.BaseProperties.GetAllLayerProperties())
|
||||||
|
keyframes.AddRange(baseLayerProperty.BaseKeyframes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return keyframes;
|
||||||
|
}
|
||||||
|
|
||||||
protected void ApplyRenderElementDefaults()
|
protected void ApplyRenderElementDefaults()
|
||||||
{
|
{
|
||||||
MainSegmentLength = TimeSpan.FromSeconds(5);
|
MainSegmentLength = TimeSpan.FromSeconds(5);
|
||||||
@ -54,21 +67,6 @@ namespace Artemis.Core.Models.Profile
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of all keyframes on all properties and effects of this layer
|
|
||||||
/// </summary>
|
|
||||||
public virtual List<BaseLayerPropertyKeyframe> GetAllKeyframes()
|
|
||||||
{
|
|
||||||
var keyframes = new List<BaseLayerPropertyKeyframe>();
|
|
||||||
foreach (var layerEffect in LayerEffects)
|
|
||||||
{
|
|
||||||
foreach (var baseLayerProperty in layerEffect.BaseProperties.GetAllLayerProperties())
|
|
||||||
keyframes.AddRange(baseLayerProperty.BaseKeyframes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return keyframes;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
private SKPath _path;
|
private SKPath _path;
|
||||||
@ -215,7 +213,7 @@ namespace Artemis.Core.Models.Profile
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the progress of the element
|
/// Overrides the progress of the element
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="timeOverride"></param>
|
/// <param name="timeOverride"></param>
|
||||||
/// <param name="stickToMainSegment"></param>
|
/// <param name="stickToMainSegment"></param>
|
||||||
|
|||||||
@ -1,20 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Extensions;
|
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
using Artemis.Storage.Entities.Surface;
|
using Artemis.Storage.Entities.Surface;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Surface
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ArtemisDevice : PropertyChangedBase
|
public class ArtemisDevice : PropertyChangedBase
|
||||||
{
|
{
|
||||||
private SKRect _renderRectangle;
|
|
||||||
private SKPath _renderPath;
|
|
||||||
private ReadOnlyCollection<ArtemisLed> _leds;
|
private ReadOnlyCollection<ArtemisLed> _leds;
|
||||||
|
private SKPath _renderPath;
|
||||||
|
private SKRect _renderRectangle;
|
||||||
|
|
||||||
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface)
|
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,13 @@
|
|||||||
using Artemis.Core.Extensions;
|
using RGB.NET.Core;
|
||||||
using RGB.NET.Core;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Surface
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ArtemisLed : PropertyChangedBase
|
public class ArtemisLed : PropertyChangedBase
|
||||||
{
|
{
|
||||||
private SKRect _renderRectangle;
|
|
||||||
private SKRect _absoluteRenderRectangle;
|
private SKRect _absoluteRenderRectangle;
|
||||||
|
private SKRect _renderRectangle;
|
||||||
|
|
||||||
public ArtemisLed(Led led, ArtemisDevice device)
|
public ArtemisLed(Led led, ArtemisDevice device)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,14 +5,14 @@ using Artemis.Storage.Entities.Surface;
|
|||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Models.Surface
|
namespace Artemis.Core
|
||||||
{
|
{
|
||||||
public class ArtemisSurface : PropertyChangedBase
|
public class ArtemisSurface : PropertyChangedBase
|
||||||
{
|
{
|
||||||
private double _scale;
|
|
||||||
private string _name;
|
|
||||||
private bool _isActive;
|
|
||||||
private List<ArtemisDevice> _devices;
|
private List<ArtemisDevice> _devices;
|
||||||
|
private bool _isActive;
|
||||||
|
private string _name;
|
||||||
|
private double _scale;
|
||||||
|
|
||||||
internal ArtemisSurface(RGBSurface rgbSurface, string name, double scale)
|
internal ArtemisSurface(RGBSurface rgbSurface, string name, double scale)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security.AccessControl;
|
using Artemis.Core.Services;
|
||||||
using System.Security.Principal;
|
|
||||||
using Artemis.Core.Exceptions;
|
|
||||||
using Artemis.Core.Plugins.Settings;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage;
|
using Artemis.Storage;
|
||||||
using Artemis.Storage.Migrations.Interfaces;
|
using Artemis.Storage.Migrations.Interfaces;
|
||||||
using Artemis.Storage.Repositories.Interfaces;
|
using Artemis.Storage.Repositories.Interfaces;
|
||||||
@ -15,8 +11,12 @@ using Serilog;
|
|||||||
|
|
||||||
namespace Artemis.Core.Ninject
|
namespace Artemis.Core.Ninject
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main <see cref="NinjectModule" /> of the Artemis Core that binds all services
|
||||||
|
/// </summary>
|
||||||
public class CoreModule : NinjectModule
|
public class CoreModule : NinjectModule
|
||||||
{
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
if (Kernel == null)
|
if (Kernel == null)
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins;
|
|
||||||
using Artemis.Core.Plugins.Settings;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using Artemis.Storage.Repositories.Interfaces;
|
using Artemis.Storage.Repositories.Interfaces;
|
||||||
using Ninject.Activation;
|
using Ninject.Activation;
|
||||||
|
|
||||||
@ -31,8 +28,10 @@ namespace Artemis.Core.Ninject
|
|||||||
pluginInfo = _pluginService.GetPluginByAssembly(parentRequest.Service.Assembly)?.PluginInfo;
|
pluginInfo = _pluginService.GetPluginByAssembly(parentRequest.Service.Assembly)?.PluginInfo;
|
||||||
// Fall back to assembly based detection
|
// Fall back to assembly based detection
|
||||||
if (pluginInfo == null)
|
if (pluginInfo == null)
|
||||||
|
{
|
||||||
throw new ArtemisCoreException("PluginSettings can only be injected with the PluginInfo parameter provided " +
|
throw new ArtemisCoreException("PluginSettings can only be injected with the PluginInfo parameter provided " +
|
||||||
"or into a class defined in a plugin assembly");
|
"or into a class defined in a plugin assembly");
|
||||||
|
}
|
||||||
|
|
||||||
return new PluginSettings(pluginInfo, _pluginRepository);
|
return new PluginSettings(pluginInfo, _pluginRepository);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
using Artemis.Core.Plugins;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Plugins.Settings;
|
|
||||||
using Artemis.Core.Services;
|
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using Ninject.Activation;
|
using Ninject.Activation;
|
||||||
|
|
||||||
namespace Artemis.Core.Ninject
|
namespace Artemis.Core.Ninject
|
||||||
{
|
{
|
||||||
public class SettingsServiceProvider : Provider<ISettingsService>
|
internal class SettingsServiceProvider : Provider<ISettingsService>
|
||||||
{
|
{
|
||||||
private readonly SettingsService _instance;
|
private readonly SettingsService _instance;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DataModelExpansions.Attributes
|
namespace Artemis.Core.DataModelExpansions
|
||||||
{
|
{
|
||||||
public class DataModelIgnoreAttribute : Attribute
|
public class DataModelIgnoreAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DataModelExpansions.Attributes
|
namespace Artemis.Core.DataModelExpansions
|
||||||
{
|
{
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
public class DataModelPropertyAttribute : Attribute
|
public class DataModelPropertyAttribute : Attribute
|
||||||
|
|||||||
@ -4,12 +4,9 @@ using System.Collections.Generic;
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.Exceptions;
|
using Artemis.Core.Modules;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
|
|
||||||
using Artemis.Core.Plugins.DataModelExpansions.Internal;
|
|
||||||
using Artemis.Core.Plugins.Modules;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DataModelExpansions
|
namespace Artemis.Core.DataModelExpansions
|
||||||
{
|
{
|
||||||
public abstract class DataModel
|
public abstract class DataModel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions.Internal;
|
|
||||||
using Artemis.Core.Utilities;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DataModelExpansions
|
namespace Artemis.Core.DataModelExpansions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows you to expand the application-wide datamodel
|
/// Allows you to expand the application-wide datamodel
|
||||||
@ -32,7 +30,8 @@ namespace Artemis.Core.Plugins.DataModelExpansions
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop hiding the provided property using a lambda expression, e.g. ShowProperty(dm => dm.TimeDataModel.CurrentTimeUTC)
|
/// Stop hiding the provided property using a lambda expression, e.g. ShowProperty(dm =>
|
||||||
|
/// dm.TimeDataModel.CurrentTimeUTC)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="propertyLambda">A lambda expression pointing to the property to stop ignoring</param>
|
/// <param name="propertyLambda">A lambda expression pointing to the property to stop ignoring</param>
|
||||||
public void ShowProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda)
|
public void ShowProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda)
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DataModelExpansions.Internal
|
namespace Artemis.Core.DataModelExpansions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, to implement your own layer property type, extend <see cref="DataModelExpansion{T}" />
|
/// For internal use only, to implement your own layer property type, extend <see cref="DataModelExpansion{T}" />
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Artemis.Core.Extensions;
|
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.DeviceProviders
|
namespace Artemis.Core.DeviceProviders
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
using Stylet;
|
||||||
using Stylet;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
public abstract class BrushConfigurationViewModel : Screen
|
public abstract class BrushConfigurationViewModel : Screen
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes.Internal
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
|
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes.Internal
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
|
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
public abstract class LayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
|
public abstract class LayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class LayerBrushConfigurationDialog<T> : LayerBrushConfigurationDialog where T : BrushConfigurationViewModel
|
public class LayerBrushConfigurationDialog<T> : LayerBrushConfigurationDialog where T : BrushConfigurationViewModel
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A class that describes a layer brush
|
/// A class that describes a layer brush
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows you to create one or more <see cref="LayerBrush{T}" />s usable by profile layers.
|
/// Allows you to create one or more <see cref="LayerBrush{T}" />s usable by profile layers.
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Models.Surface;
|
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
public abstract class PerLedLayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
|
public abstract class PerLedLayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.LayerBrushes.Internal;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using RGB.NET.Groups;
|
using RGB.NET.Groups;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerBrushes
|
namespace Artemis.Core.LayerBrushes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An RGB.NET brush that uses RGB.NET's per-LED rendering engine.
|
/// An RGB.NET brush that uses RGB.NET's per-LED rendering engine.
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
public abstract class EffectConfigurationViewModel : Screen
|
public abstract class EffectConfigurationViewModel : Screen
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using Stylet;
|
using Stylet;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For internal use only, please use <see cref="LayerEffect{T}" /> instead
|
/// For internal use only, please use <see cref="LayerEffect{T}" /> instead
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseLayerEffect : PropertyChangedBase, IDisposable
|
public abstract class BaseLayerEffect : PropertyChangedBase, IDisposable
|
||||||
{
|
{
|
||||||
|
private LayerEffectConfigurationDialog _configurationDialog;
|
||||||
private LayerEffectDescriptor _descriptor;
|
private LayerEffectDescriptor _descriptor;
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
private Guid _entityId;
|
private Guid _entityId;
|
||||||
@ -18,7 +18,6 @@ namespace Artemis.Core.Plugins.LayerEffects
|
|||||||
private string _name;
|
private string _name;
|
||||||
private int _order;
|
private int _order;
|
||||||
private RenderProfileElement _profileElement;
|
private RenderProfileElement _profileElement;
|
||||||
private LayerEffectConfigurationDialog _configurationDialog;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the unique ID of this effect
|
/// Gets the unique ID of this effect
|
||||||
@ -76,7 +75,7 @@ namespace Artemis.Core.Plugins.LayerEffects
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="LayerEffectDescriptor"/> that registered this effect
|
/// Gets the <see cref="LayerEffectDescriptor" /> that registered this effect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public LayerEffectDescriptor Descriptor
|
public LayerEffectDescriptor Descriptor
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Services;
|
||||||
using Artemis.Core.Plugins.Exceptions;
|
|
||||||
using Artemis.Core.Services.Interfaces;
|
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
public abstract class LayerEffect<T> : BaseLayerEffect where T : LayerPropertyGroup
|
public abstract class LayerEffect<T> : BaseLayerEffect where T : LayerPropertyGroup
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class LayerEffectConfigurationDialog<T> : LayerEffectConfigurationDialog where T : EffectConfigurationViewModel
|
public class LayerEffectConfigurationDialog<T> : LayerEffectConfigurationDialog where T : EffectConfigurationViewModel
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Artemis.Core.Plugins.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A class that describes a layer effect
|
/// A class that describes a layer effect
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user