diff --git a/src/Artemis.Core/Artemis.Core.csproj.DotSettings b/src/Artemis.Core/Artemis.Core.csproj.DotSettings new file mode 100644 index 000000000..babfa2469 --- /dev/null +++ b/src/Artemis.Core/Artemis.Core.csproj.DotSettings @@ -0,0 +1,29 @@ + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/src/Artemis.Core/Constants.cs b/src/Artemis.Core/Constants.cs index 5762b16eb..0fa81409d 100644 --- a/src/Artemis.Core/Constants.cs +++ b/src/Artemis.Core/Constants.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using Artemis.Core.Plugins; namespace Artemis.Core { @@ -15,6 +14,11 @@ namespace Artemis.Core /// public static readonly string ApplicationFolder = Path.GetDirectoryName(typeof(Constants).Assembly.Location); + /// + /// The full path to the Artemis executable + /// + public static readonly string ExecutablePath = ApplicationUtilities.GetCurrentLocation(); + /// /// The full path to the Artemis data folder /// diff --git a/src/Artemis.Core/Events/DeviceConfigurationEventArgs.cs b/src/Artemis.Core/Events/DeviceConfigurationEventArgs.cs index 94eae8f38..ba4ce72de 100644 --- a/src/Artemis.Core/Events/DeviceConfigurationEventArgs.cs +++ b/src/Artemis.Core/Events/DeviceConfigurationEventArgs.cs @@ -1,7 +1,6 @@ using System; -using Artemis.Core.Models.Surface; -namespace Artemis.Core.Events +namespace Artemis.Core { public class SurfaceConfigurationEventArgs : EventArgs { diff --git a/src/Artemis.Core/Events/DeviceEventArgs.cs b/src/Artemis.Core/Events/DeviceEventArgs.cs index 1401cee36..1d4f3eabc 100644 --- a/src/Artemis.Core/Events/DeviceEventArgs.cs +++ b/src/Artemis.Core/Events/DeviceEventArgs.cs @@ -1,7 +1,7 @@ using System; using RGB.NET.Core; -namespace Artemis.Core.Events +namespace Artemis.Core { public class DeviceEventArgs : EventArgs { diff --git a/src/Artemis.Core/Events/FrameRenderedEventArgs.cs b/src/Artemis.Core/Events/FrameRenderedEventArgs.cs index 5267bd344..22f91ded7 100644 --- a/src/Artemis.Core/Events/FrameRenderedEventArgs.cs +++ b/src/Artemis.Core/Events/FrameRenderedEventArgs.cs @@ -1,8 +1,7 @@ using System; -using Artemis.Core.RGB.NET; using RGB.NET.Core; -namespace Artemis.Core.Events +namespace Artemis.Core { public class FrameRenderedEventArgs : EventArgs { diff --git a/src/Artemis.Core/Events/FrameRenderingEventArgs.cs b/src/Artemis.Core/Events/FrameRenderingEventArgs.cs index 1066a2950..89e0dbd45 100644 --- a/src/Artemis.Core/Events/FrameRenderingEventArgs.cs +++ b/src/Artemis.Core/Events/FrameRenderingEventArgs.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; -using Artemis.Core.Plugins.Modules; +using Artemis.Core.Modules; using RGB.NET.Core; using SkiaSharp; -namespace Artemis.Core.Events +namespace Artemis.Core { public class FrameRenderingEventArgs : EventArgs { diff --git a/src/Artemis.Core/Events/LayerPropertyEventArgs.cs b/src/Artemis.Core/Events/LayerPropertyEventArgs.cs index 9f16dc690..c469947d0 100644 --- a/src/Artemis.Core/Events/LayerPropertyEventArgs.cs +++ b/src/Artemis.Core/Events/LayerPropertyEventArgs.cs @@ -1,7 +1,6 @@ using System; -using Artemis.Core.Models.Profile.LayerProperties; -namespace Artemis.Core.Events +namespace Artemis.Core { public class LayerPropertyEventArgs : EventArgs { diff --git a/src/Artemis.Core/Events/PluginEventArgs.cs b/src/Artemis.Core/Events/PluginEventArgs.cs index 8c71dcd2b..9f69f4974 100644 --- a/src/Artemis.Core/Events/PluginEventArgs.cs +++ b/src/Artemis.Core/Events/PluginEventArgs.cs @@ -1,7 +1,6 @@ using System; -using Artemis.Core.Plugins; -namespace Artemis.Core.Events +namespace Artemis.Core { public class PluginEventArgs : EventArgs { diff --git a/src/Artemis.Core/Exceptions/ArtemisCoreException.cs b/src/Artemis.Core/Exceptions/ArtemisCoreException.cs index 163368e3d..a6aa34341 100644 --- a/src/Artemis.Core/Exceptions/ArtemisCoreException.cs +++ b/src/Artemis.Core/Exceptions/ArtemisCoreException.cs @@ -1,18 +1,17 @@ using System; -namespace Artemis.Core.Exceptions +namespace Artemis.Core { + /// + /// Represents errors that occur withing the Artemis Core + /// public class ArtemisCoreException : Exception { - public ArtemisCoreException() + internal ArtemisCoreException(string message) : base(message) { } - public ArtemisCoreException(string message) : base(message) - { - } - - public ArtemisCoreException(string message, Exception inner) : base(message, inner) + internal ArtemisCoreException(string message, Exception inner) : base(message, inner) { } } diff --git a/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs b/src/Artemis.Core/Exceptions/ArtemisPluginException.cs similarity index 94% rename from src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs rename to src/Artemis.Core/Exceptions/ArtemisPluginException.cs index a69362c39..c0a889ce1 100644 --- a/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginException.cs +++ b/src/Artemis.Core/Exceptions/ArtemisPluginException.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.Exceptions +namespace Artemis.Core { public class ArtemisPluginException : Exception { diff --git a/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginLockException.cs b/src/Artemis.Core/Exceptions/ArtemisPluginLockException.cs similarity index 92% rename from src/Artemis.Core/Plugins/Exceptions/ArtemisPluginLockException.cs rename to src/Artemis.Core/Exceptions/ArtemisPluginLockException.cs index 3fa5c4674..c6cb4c8f0 100644 --- a/src/Artemis.Core/Plugins/Exceptions/ArtemisPluginLockException.cs +++ b/src/Artemis.Core/Exceptions/ArtemisPluginLockException.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.Exceptions +namespace Artemis.Core { public class ArtemisPluginLockException : Exception { diff --git a/src/Artemis.Core/Extensions/DirectoryInfoExtensions.cs b/src/Artemis.Core/Extensions/DirectoryInfoExtensions.cs index 641e938e8..164f8ef2e 100644 --- a/src/Artemis.Core/Extensions/DirectoryInfoExtensions.cs +++ b/src/Artemis.Core/Extensions/DirectoryInfoExtensions.cs @@ -1,6 +1,6 @@ using System.IO; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class DirectoryInfoExtensions { diff --git a/src/Artemis.Core/Extensions/DoubleExtensions.cs b/src/Artemis.Core/Extensions/DoubleExtensions.cs index 62ec1117e..42cfcfbc1 100644 --- a/src/Artemis.Core/Extensions/DoubleExtensions.cs +++ b/src/Artemis.Core/Extensions/DoubleExtensions.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.CompilerServices; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class DoubleExtensions { diff --git a/src/Artemis.Core/Extensions/FloatExtensions.cs b/src/Artemis.Core/Extensions/FloatExtensions.cs index 45441588e..a6c5ba7b8 100644 --- a/src/Artemis.Core/Extensions/FloatExtensions.cs +++ b/src/Artemis.Core/Extensions/FloatExtensions.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class FloatExtensions { diff --git a/src/Artemis.Core/Extensions/IEnumerableExtensions.cs b/src/Artemis.Core/Extensions/IEnumerableExtensions.cs index c4c0363a4..8a33844e5 100644 --- a/src/Artemis.Core/Extensions/IEnumerableExtensions.cs +++ b/src/Artemis.Core/Extensions/IEnumerableExtensions.cs @@ -22,7 +22,7 @@ using System; using System.Collections.Generic; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class IEnumerableExtensions { diff --git a/src/Artemis.Core/Extensions/ProcessExtensions.cs b/src/Artemis.Core/Extensions/ProcessExtensions.cs index 3353ed60d..ce59cde59 100644 --- a/src/Artemis.Core/Extensions/ProcessExtensions.cs +++ b/src/Artemis.Core/Extensions/ProcessExtensions.cs @@ -1,10 +1,9 @@ using System; -using System.Collections.Generic; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class ProcessExtensions { @@ -30,4 +29,4 @@ namespace Artemis.Core.Extensions QueryLimitedInformation = 0x00001000 } } -} +} \ No newline at end of file diff --git a/src/Artemis.Core/Extensions/RgbDeviceExtensions.cs b/src/Artemis.Core/Extensions/RgbDeviceExtensions.cs index 16ffad995..baa0c1f11 100644 --- a/src/Artemis.Core/Extensions/RgbDeviceExtensions.cs +++ b/src/Artemis.Core/Extensions/RgbDeviceExtensions.cs @@ -1,7 +1,7 @@ using System.Text; using RGB.NET.Core; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class RgbDeviceExtensions { diff --git a/src/Artemis.Core/Extensions/RgbRectangleExtensions.cs b/src/Artemis.Core/Extensions/RgbRectangleExtensions.cs index 3910dc9a0..6f58a0e46 100644 --- a/src/Artemis.Core/Extensions/RgbRectangleExtensions.cs +++ b/src/Artemis.Core/Extensions/RgbRectangleExtensions.cs @@ -1,7 +1,7 @@ using RGB.NET.Core; using SkiaSharp; -namespace Artemis.Core.Extensions +namespace Artemis.Core { public static class RgbRectangleExtensions { diff --git a/src/Artemis.Core/Extensions/SKColorExtensions.cs b/src/Artemis.Core/Extensions/SKColorExtensions.cs index d638b4967..5e62f6a24 100644 --- a/src/Artemis.Core/Extensions/SKColorExtensions.cs +++ b/src/Artemis.Core/Extensions/SKColorExtensions.cs @@ -2,7 +2,7 @@ using RGB.NET.Core; using SkiaSharp; -namespace Artemis.Core.Extensions +namespace Artemis.Core { // ReSharper disable once InconsistentNaming - I didn't come up with SKColor public static class SKColorExtensions @@ -29,7 +29,7 @@ namespace Artemis.Core.Extensions private static byte ClampToByte(float value) { - return (byte)Math.Clamp(value, 0, 255); + return (byte) Math.Clamp(value, 0, 255); } } } \ No newline at end of file diff --git a/src/Artemis.Core/Extensions/TypeExtensions.cs b/src/Artemis.Core/Extensions/TypeExtensions.cs index 02aab161f..027610874 100644 --- a/src/Artemis.Core/Extensions/TypeExtensions.cs +++ b/src/Artemis.Core/Extensions/TypeExtensions.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -namespace Artemis.Core.Extensions +namespace Artemis.Core { 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 /// - /// 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 /// /// /// diff --git a/src/Artemis.Core/JsonConverters/SKColorConverter.cs b/src/Artemis.Core/JsonConverters/SKColorConverter.cs index e2b17cd40..b12e1d7c4 100644 --- a/src/Artemis.Core/JsonConverters/SKColorConverter.cs +++ b/src/Artemis.Core/JsonConverters/SKColorConverter.cs @@ -4,7 +4,7 @@ using SkiaSharp; namespace Artemis.Core.JsonConverters { - public class SKColorConverter : JsonConverter + internal class SKColorConverter : JsonConverter { public override void WriteJson(JsonWriter writer, SKColor value, JsonSerializer serializer) { diff --git a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs index 48c66771e..d8a72622a 100644 --- a/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs +++ b/src/Artemis.Core/Models/Profile/Colors/ColorGradient.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; -using Artemis.Core.Annotations; +using Artemis.Core.Properties; using SkiaSharp; using Stylet; -namespace Artemis.Core.Models.Profile.Colors +namespace Artemis.Core { /// /// A gradient containing a list of s @@ -136,7 +136,7 @@ namespace Artemis.Core.Models.Profile.Colors /// public event PropertyChangedEventHandler PropertyChanged; - + [NotifyPropertyChangedInvocator] internal virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { diff --git a/src/Artemis.Core/Models/Profile/Colors/ColorGradientStop.cs b/src/Artemis.Core/Models/Profile/Colors/ColorGradientStop.cs index 71bc35f52..f3009706e 100644 --- a/src/Artemis.Core/Models/Profile/Colors/ColorGradientStop.cs +++ b/src/Artemis.Core/Models/Profile/Colors/ColorGradientStop.cs @@ -1,9 +1,9 @@ using System.ComponentModel; using System.Runtime.CompilerServices; -using Artemis.Core.Annotations; +using Artemis.Core.Properties; using SkiaSharp; -namespace Artemis.Core.Models.Profile.Colors +namespace Artemis.Core { /// /// A color with a position, usually contained in a diff --git a/src/Artemis.Core/Models/Profile/Conditions/Abstract/DisplayConditionPart.cs b/src/Artemis.Core/Models/Profile/Conditions/Abstract/DisplayConditionPart.cs index 898e824cc..2ae490f56 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Abstract/DisplayConditionPart.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Abstract/DisplayConditionPart.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.Abstract; -namespace Artemis.Core.Models.Profile.Conditions.Abstract +namespace Artemis.Core { /// /// An abstract class for display condition parts @@ -10,7 +10,7 @@ namespace Artemis.Core.Models.Profile.Conditions.Abstract public abstract class DisplayConditionPart { private readonly List _children = new List(); - + /// /// Gets the parent of this part /// diff --git a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionGroup.cs b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionGroup.cs index 640216e7e..c93bb0612 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionGroup.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionGroup.cs @@ -1,12 +1,10 @@ using System; using System.Linq; -using Artemis.Core.Models.Profile.Conditions.Abstract; -using Artemis.Core.Services.Interfaces; -using Artemis.Storage.Entities.Profile; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.Abstract; using Artemis.Storage.Entities.Profile.Conditions; -namespace Artemis.Core.Models.Profile.Conditions +namespace Artemis.Core { /// /// A group containing zero to many s which it evaluates using a boolean specific diff --git a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionList.cs b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionList.cs index 1bcd9f271..4bb1a587d 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionList.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionList.cs @@ -2,15 +2,12 @@ using System.Collections; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile.Conditions.Abstract; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Services.Interfaces; -using Artemis.Storage.Entities.Profile; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.Abstract; using Artemis.Storage.Entities.Profile.Conditions; -namespace Artemis.Core.Models.Profile.Conditions +namespace Artemis.Core { public class DisplayConditionList : DisplayConditionPart { @@ -33,6 +30,8 @@ namespace Artemis.Core.Models.Profile.Conditions public DataModel ListDataModel { get; private set; } public string ListPropertyPath { get; private set; } + public Func CompiledListAccessor { get; set; } + public override bool Evaluate() { 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( + Expression.Convert(parameter, ListDataModel.GetType()), + (expression, s) => Expression.Convert(Expression.Property(expression, s), typeof(IList))); + + var lambda = Expression.Lambda>(accessor, parameter); + CompiledListAccessor = lambda.Compile(); + } + internal override void ApplyToEntity() { // Target list @@ -103,51 +143,9 @@ namespace Artemis.Core.Models.Profile.Conditions Entity.Children.Clear(); AddChild(new DisplayConditionGroup(this)); } + 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( - Expression.Convert(parameter, ListDataModel.GetType()), - (expression, s) => Expression.Convert(Expression.Property(expression, s), typeof(IList))); - - var lambda = Expression.Lambda>(accessor, parameter); - CompiledListAccessor = lambda.Compile(); - } - - public Func CompiledListAccessor { get; set; } } public enum ListOperator diff --git a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionListPredicate.cs b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionListPredicate.cs index 4c0f9dbb9..6afee4a2f 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionListPredicate.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionListPredicate.cs @@ -1,16 +1,13 @@ using System; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Exceptions; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.Conditions.Abstract; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.Abstract; using Artemis.Storage.Entities.Profile.Conditions; using Newtonsoft.Json; -namespace Artemis.Core.Models.Profile.Conditions +namespace Artemis.Core { public class DisplayConditionListPredicate : DisplayConditionPart { diff --git a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionOperator.cs index 235fe13f0..cb592b5e5 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionOperator.cs @@ -2,11 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; -namespace Artemis.Core.Models.Profile.Conditions +namespace Artemis.Core { /// /// A display condition operator is used by the conditions system to perform a specific boolean check diff --git a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionPredicate.cs b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionPredicate.cs index a1e34f885..617de25f1 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionPredicate.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/DisplayConditionPredicate.cs @@ -1,16 +1,13 @@ using System; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Exceptions; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.Conditions.Abstract; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.Abstract; using Artemis.Storage.Entities.Profile.Conditions; using Newtonsoft.Json; -namespace Artemis.Core.Models.Profile.Conditions +namespace Artemis.Core { /// /// 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); if (!displayConditionOperator.SupportsType(leftType)) + { throw new ArtemisCoreException($"Cannot apply operator {displayConditionOperator.GetType().Name} to this predicate because " + $"it does not support left side type {leftType.Name}"); + } Operator = displayConditionOperator; CreateExpression(); diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs index b70f5dc01..44388b7c1 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class EqualsConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs index 121e7f10a..37dbccadb 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class GreaterThanConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs index 444ac15c6..578c20aab 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class GreaterThanOrEqualConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs index 0ce64ff72..244b15c08 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class LessThanConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs index 092c5d7af..e47b3f018 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class LessThanOrEqualConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs index 84a025987..a1a9934be 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs @@ -2,11 +2,11 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class NotEqualConditionOperator : DisplayConditionOperator { - public override IReadOnlyCollection CompatibleTypes => new List { typeof(object) }; + public override IReadOnlyCollection CompatibleTypes => new List {typeof(object)}; public override string Description => "Does not equal"; public override string Icon => "NotEqualVariant"; diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs index cb8f326f3..758e0400e 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs @@ -3,17 +3,17 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringContainsConditionOperator : DisplayConditionOperator { - private readonly MethodInfo _toLower; private readonly MethodInfo _contains; + private readonly MethodInfo _toLower; public StringContainsConditionOperator() { _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 CompatibleTypes => new List {typeof(string)}; diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs index b117b3a4e..38ed72633 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs @@ -3,20 +3,20 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringEndsWithConditionOperator : DisplayConditionOperator { - private readonly MethodInfo _toLower; private readonly MethodInfo _endsWith; + private readonly MethodInfo _toLower; public StringEndsWithConditionOperator() { _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 CompatibleTypes => new List { typeof(string) }; + public override IReadOnlyCollection CompatibleTypes => new List {typeof(string)}; public override string Description => "Ends with"; public override string Icon => "ContainEnd"; diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs index 4c3006e32..91a58ec91 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringEqualsConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs index 682269b9c..671555eb5 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs @@ -3,20 +3,20 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringNotContainsConditionOperator : DisplayConditionOperator { - private readonly MethodInfo _toLower; private readonly MethodInfo _contains; + private readonly MethodInfo _toLower; public StringNotContainsConditionOperator() { _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 CompatibleTypes => new List { typeof(string) }; + public override IReadOnlyCollection CompatibleTypes => new List {typeof(string)}; public override string Description => "Does not contain"; public override string Icon => "FormatStrikethrough"; diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs index ebef98d93..c98d4bef3 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringNotEqualConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs index 0fc2c8394..bb0b99d42 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringNullConditionOperator : DisplayConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs index 3049d1ec8..f9f9fbf8e 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs @@ -3,20 +3,20 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Models.Profile.Conditions.Operators +namespace Artemis.Core { internal class StringStartsWithConditionOperator : DisplayConditionOperator { - private readonly MethodInfo _toLower; private readonly MethodInfo _startsWith; + private readonly MethodInfo _toLower; public StringStartsWithConditionOperator() { _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 CompatibleTypes => new List { typeof(string) }; + public override IReadOnlyCollection CompatibleTypes => new List {typeof(string)}; public override string Description => "Starts with"; public override string Icon => "ContainStart"; diff --git a/src/Artemis.Core/Models/Profile/DataBindings/DataBinding.cs b/src/Artemis.Core/Models/Profile/DataBindings/DataBinding.cs index e15a79785..1c1121b16 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/DataBinding.cs +++ b/src/Artemis.Core/Models/Profile/DataBindings/DataBinding.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; -using Artemis.Core.Models.Profile.LayerProperties; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; -namespace Artemis.Core.Models.Profile.DataBindings +namespace Artemis.Core { /// /// A data binding that binds a certain to a value inside a diff --git a/src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifier.cs b/src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifier.cs index 4e34c3682..8e3ba1ac4 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifier.cs +++ b/src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifier.cs @@ -1,14 +1,12 @@ using System; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile.DataBindings.Modifiers; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile.DataBindings; using Newtonsoft.Json; -namespace Artemis.Core.Models.Profile.DataBindings +namespace Artemis.Core { /// /// Modifies a data model value in a way defined by the modifier type diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DataBindingModifierType.cs b/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DataBindingModifierType.cs index c6ee9ce9e..ecac3e009 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DataBindingModifierType.cs +++ b/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DataBindingModifierType.cs @@ -2,20 +2,17 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins; using Artemis.Core.Services; -using Artemis.Core.Services.Interfaces; -namespace Artemis.Core.Models.Profile.DataBindings.Modifiers +namespace Artemis.Core { /// - /// 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 /// public abstract class DataBindingModifierType { - private bool _registered; private IDataBindingService _dataBindingService; + private bool _registered; /// /// Gets the plugin info this data binding modifier belongs to diff --git a/src/Artemis.Core/Models/Profile/Folder.cs b/src/Artemis.Core/Models/Profile/Folder.cs index a432d6a62..e10744485 100644 --- a/src/Artemis.Core/Models/Profile/Folder.cs +++ b/src/Artemis.Core/Models/Profile/Folder.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using Artemis.Core.Plugins.LayerEffects; -using Artemis.Core.Utilities; +using Artemis.Core.LayerEffects; using Artemis.Storage.Entities.Profile; using Artemis.Storage.Entities.Profile.Abstract; using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public sealed class Folder : RenderProfileElement { @@ -183,7 +182,7 @@ namespace Artemis.Core.Models.Profile profileElement.Render(deltaTime, folderCanvas, _folderBitmap.Info); folderCanvas.Restore(); } - + // If required, apply the opacity override of the module to the root folder if (IsRootFolder && Profile.Module.OpacityOverride < 1) { diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index b97a13592..7ced36400 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -2,21 +2,14 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.LayerProperties; -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.LayerBrushes; +using Artemis.Core.LayerEffects; using Artemis.Core.Services; -using Artemis.Core.Services.Interfaces; using Artemis.Storage.Entities.Profile; using Artemis.Storage.Entities.Profile.Abstract; using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { /// /// Represents a layer on a profile. To create new layers use the by injecting @@ -232,10 +225,10 @@ namespace Artemis.Core.Models.Profile switch (General.ShapeType.CurrentValue) { case LayerShapeType.Ellipse: - LayerShape = new Ellipse(this); + LayerShape = new EllipseShape(this); break; case LayerShapeType.Rectangle: - LayerShape = new Rectangle(this); + LayerShape = new RectangleShape(this); break; default: throw new ArgumentOutOfRangeException(); @@ -291,9 +284,7 @@ namespace Artemis.Core.Models.Profile if (stickToMainSegment) { if (!DisplayContinuously) - { TimelinePosition = StartSegmentLength + timeOverride; - } else { var progress = timeOverride.TotalMilliseconds % MainSegmentLength.TotalMilliseconds; diff --git a/src/Artemis.Core/Models/Profile/LayerBrushReference.cs b/src/Artemis.Core/Models/Profile/LayerBrushReference.cs index 3d575c9c9..588fac723 100644 --- a/src/Artemis.Core/Models/Profile/LayerBrushReference.cs +++ b/src/Artemis.Core/Models/Profile/LayerBrushReference.cs @@ -1,7 +1,7 @@ using System; -using Artemis.Core.Plugins.LayerBrushes; +using Artemis.Core.LayerBrushes; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { /// /// A reference to a diff --git a/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs b/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs index 6ce5fa92f..40b4cb7eb 100644 --- a/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs +++ b/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs @@ -1,8 +1,6 @@ -using Artemis.Core.Models.Profile.LayerProperties.Attributes; -using Artemis.Core.Models.Profile.LayerProperties.Types; -using SkiaSharp; +using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public class LayerGeneralProperties : LayerPropertyGroup { diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyDescriptionAttribute.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyDescriptionAttribute.cs index 48b83535a..733c95683 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyDescriptionAttribute.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyDescriptionAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Models.Profile.LayerProperties.Attributes +namespace Artemis.Core { public class PropertyDescriptionAttribute : Attribute { diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyGroupDescriptionAttribute.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyGroupDescriptionAttribute.cs index bc43d5eac..572b5508a 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyGroupDescriptionAttribute.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Attributes/PropertyGroupDescriptionAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Models.Profile.LayerProperties.Attributes +namespace Artemis.Core { public class PropertyGroupDescriptionAttribute : Attribute { diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs index b86126d13..f616f352b 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using System.Reflection; -using Artemis.Core.Events; -using Artemis.Core.Models.Profile.LayerProperties.Attributes; using Artemis.Storage.Entities.Profile; -namespace Artemis.Core.Models.Profile.LayerProperties +namespace Artemis.Core { /// /// For internal use only, to implement your own layer property type, extend instead. diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerPropertyKeyframe.cs b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerPropertyKeyframe.cs index e90536c18..ced2050b9 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerPropertyKeyframe.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerPropertyKeyframe.cs @@ -1,8 +1,7 @@ using System; -using Artemis.Core.Utilities; using Stylet; -namespace Artemis.Core.Models.Profile.LayerProperties +namespace Artemis.Core { /// /// For internal use only, use instead. diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs index 10773047a..9f47f97d4 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/LayerProperty.cs @@ -3,12 +3,10 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; -using Artemis.Core.Exceptions; -using Artemis.Core.Utilities; using Artemis.Storage.Entities.Profile; using Newtonsoft.Json; -namespace Artemis.Core.Models.Profile.LayerProperties +namespace Artemis.Core { /// /// 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 } /// - public override Type GetPropertyType() => typeof(T); + public override Type GetPropertyType() + { + return typeof(T); + } /// public override List GetDataBindingProperties() diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/LayerPropertyKeyFrame.cs b/src/Artemis.Core/Models/Profile/LayerProperties/LayerPropertyKeyFrame.cs index a2257cefe..8ed7642bf 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/LayerPropertyKeyFrame.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/LayerPropertyKeyFrame.cs @@ -1,13 +1,12 @@ using System; -using Artemis.Core.Utilities; -namespace Artemis.Core.Models.Profile.LayerProperties +namespace Artemis.Core { public class LayerPropertyKeyframe : BaseLayerPropertyKeyframe { + private LayerProperty _layerProperty; private TimeSpan _position; private T _value; - private LayerProperty _layerProperty; public LayerPropertyKeyframe(T value, TimeSpan position, Easings.Functions easingFunction, LayerProperty layerProperty) : base(layerProperty) { diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs index f326a8ca4..a0598537a 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs @@ -1,8 +1,6 @@ -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile.Colors; -using Artemis.Storage.Entities.Profile; +using Artemis.Storage.Entities.Profile; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class ColorGradientLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs index 00132833b..0f0abd777 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs @@ -1,7 +1,6 @@ using System; -using Artemis.Core.Exceptions; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class EnumLayerProperty : LayerProperty where T : Enum diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs index 64206f7fc..3ec2efd90 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class FloatLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs index eca8b15ae..16600970b 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class IntLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs index 6df2e1723..fcab68db6 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs @@ -1,6 +1,4 @@ -using Artemis.Core.Exceptions; - -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// /// A special layer property used to configure the selected layer brush diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs index 2ad1452b9..3895fd3a5 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs @@ -1,8 +1,7 @@ using System; -using Artemis.Core.Extensions; using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class SKColorLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs index b94227a7b..b7c608f54 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs @@ -1,6 +1,6 @@ using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class SKPointLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs index 80c9ddd9c..bf3a0a00c 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Reflection; using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerProperties.Types +namespace Artemis.Core { /// public class SKSizeLayerProperty : LayerProperty @@ -17,16 +17,16 @@ namespace Artemis.Core.Models.Profile.LayerProperties.Types return p.CurrentValue; } + public override List GetDataBindingProperties() + { + return typeof(SKSize).GetProperties().Where(p => p.CanWrite).ToList(); + } + protected override void UpdateCurrentValue(float keyframeProgress, float keyframeProgressEased) { var widthDiff = NextKeyframe.Value.Width - CurrentKeyframe.Value.Width; var heightDiff = NextKeyframe.Value.Height - CurrentKeyframe.Value.Height; CurrentValue = new SKSize(CurrentKeyframe.Value.Width + widthDiff * keyframeProgressEased, CurrentKeyframe.Value.Height + heightDiff * keyframeProgressEased); } - - public override List GetDataBindingProperties() - { - return typeof(SKSize).GetProperties().Where(p => p.CanWrite).ToList(); - } } } \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs b/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs index 0898786a3..2a05e7daf 100644 --- a/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs +++ b/src/Artemis.Core/Models/Profile/LayerPropertyGroup.cs @@ -2,19 +2,13 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Annotations; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile.LayerProperties; -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.Core.LayerBrushes; +using Artemis.Core.LayerEffects; +using Artemis.Core.Properties; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public abstract class LayerPropertyGroup : IDisposable { @@ -89,6 +83,13 @@ namespace Artemis.Core.Models.Profile /// public ReadOnlyCollection LayerPropertyGroups => _layerPropertyGroups.AsReadOnly(); + public void Dispose() + { + DisableProperties(); + foreach (var layerPropertyGroup in _layerPropertyGroups) + layerPropertyGroup.Dispose(); + } + /// /// Recursively gets all layer properties on this group and any subgroups /// @@ -108,13 +109,6 @@ namespace Artemis.Core.Models.Profile return _allLayerProperties; } - public void Dispose() - { - DisableProperties(); - foreach (var layerPropertyGroup in _layerPropertyGroups) - layerPropertyGroup.Dispose(); - } - /// /// Called before property group is activated to allow you to populate on /// the properties you want diff --git a/src/Artemis.Core/Models/Profile/LayerShapes/Ellipse.cs b/src/Artemis.Core/Models/Profile/LayerShapes/EllipseShape.cs similarity index 54% rename from src/Artemis.Core/Models/Profile/LayerShapes/Ellipse.cs rename to src/Artemis.Core/Models/Profile/LayerShapes/EllipseShape.cs index 58a9f5d85..b699aafe0 100644 --- a/src/Artemis.Core/Models/Profile/LayerShapes/Ellipse.cs +++ b/src/Artemis.Core/Models/Profile/LayerShapes/EllipseShape.cs @@ -1,13 +1,17 @@ using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerShapes +namespace Artemis.Core { - public class Ellipse : LayerShape + /// + /// Represents an ellipse layer shape + /// + public class EllipseShape : LayerShape { - public Ellipse(Layer layer) : base(layer) + internal EllipseShape(Layer layer) : base(layer) { } + /// public override void CalculateRenderProperties() { var path = new SKPath(); diff --git a/src/Artemis.Core/Models/Profile/LayerShapes/LayerShape.cs b/src/Artemis.Core/Models/Profile/LayerShapes/LayerShape.cs index 61b15eb95..d9d6f7873 100644 --- a/src/Artemis.Core/Models/Profile/LayerShapes/LayerShape.cs +++ b/src/Artemis.Core/Models/Profile/LayerShapes/LayerShape.cs @@ -1,10 +1,13 @@ using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerShapes +namespace Artemis.Core { + /// + /// Represents the shape of a layer + /// public abstract class LayerShape { - protected LayerShape(Layer layer) + internal LayerShape(Layer layer) { Layer = layer; } @@ -19,6 +22,9 @@ namespace Artemis.Core.Models.Profile.LayerShapes /// public SKPath Path { get; protected set; } + /// + /// Calculates the + /// public abstract void CalculateRenderProperties(); } } \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/LayerShapes/Rectangle.cs b/src/Artemis.Core/Models/Profile/LayerShapes/RectangleShape.cs similarity index 53% rename from src/Artemis.Core/Models/Profile/LayerShapes/Rectangle.cs rename to src/Artemis.Core/Models/Profile/LayerShapes/RectangleShape.cs index 21d914636..a6aa13b36 100644 --- a/src/Artemis.Core/Models/Profile/LayerShapes/Rectangle.cs +++ b/src/Artemis.Core/Models/Profile/LayerShapes/RectangleShape.cs @@ -1,13 +1,17 @@ using SkiaSharp; -namespace Artemis.Core.Models.Profile.LayerShapes +namespace Artemis.Core { - public class Rectangle : LayerShape + /// + /// Represents a rectangular layer shape + /// + public class RectangleShape : LayerShape { - public Rectangle(Layer layer) : base(layer) + internal RectangleShape(Layer layer) : base(layer) { } + /// public override void CalculateRenderProperties() { var path = new SKPath(); diff --git a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs index 8a6afca51..7c9d8c2ff 100644 --- a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs +++ b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs @@ -1,8 +1,6 @@ -using Artemis.Core.Models.Profile.LayerProperties.Attributes; -using Artemis.Core.Models.Profile.LayerProperties.Types; -using SkiaSharp; +using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public class LayerTransformProperties : LayerPropertyGroup { diff --git a/src/Artemis.Core/Models/Profile/Profile.cs b/src/Artemis.Core/Models/Profile/Profile.cs index 6392d828c..030cf786f 100644 --- a/src/Artemis.Core/Models/Profile/Profile.cs +++ b/src/Artemis.Core/Models/Profile/Profile.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.Modules; +using Artemis.Core.Modules; using Artemis.Storage.Entities.Profile; using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public sealed class Profile : ProfileElement { diff --git a/src/Artemis.Core/Models/Profile/ProfileDescriptor.cs b/src/Artemis.Core/Models/Profile/ProfileDescriptor.cs index 6ce41edf1..7c91c4f6a 100644 --- a/src/Artemis.Core/Models/Profile/ProfileDescriptor.cs +++ b/src/Artemis.Core/Models/Profile/ProfileDescriptor.cs @@ -1,8 +1,8 @@ using System; -using Artemis.Core.Plugins.Modules; +using Artemis.Core.Modules; using Artemis.Storage.Entities.Profile; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public class ProfileDescriptor { diff --git a/src/Artemis.Core/Models/Profile/ProfileElement.cs b/src/Artemis.Core/Models/Profile/ProfileElement.cs index 5316a4b69..efa5bdb52 100644 --- a/src/Artemis.Core/Models/Profile/ProfileElement.cs +++ b/src/Artemis.Core/Models/Profile/ProfileElement.cs @@ -5,23 +5,10 @@ using System.Linq; using SkiaSharp; using Stylet; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { 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; private bool _enabled; private Guid _entityId; @@ -86,6 +73,12 @@ namespace Artemis.Core.Models.Profile set => SetAndNotify(ref _enabled, value); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + /// /// Updates the element /// @@ -201,6 +194,13 @@ namespace Artemis.Core.Models.Profile return $"{nameof(EntityId)}: {EntityId}, {nameof(Order)}: {Order}, {nameof(Name)}: {Name}"; } + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + } + } + /// /// Applies the profile element's properties to the underlying storage entity /// diff --git a/src/Artemis.Core/Models/Profile/ProfileRightSideType.cs b/src/Artemis.Core/Models/Profile/ProfileRightSideType.cs index 55f95795c..b07c20bda 100644 --- a/src/Artemis.Core/Models/Profile/ProfileRightSideType.cs +++ b/src/Artemis.Core/Models/Profile/ProfileRightSideType.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { /// /// An enum defining the right side type of a profile entity diff --git a/src/Artemis.Core/Models/Profile/PropertiesProfileElement.cs b/src/Artemis.Core/Models/Profile/PropertiesProfileElement.cs index 4fc04ac97..0759ed0e5 100644 --- a/src/Artemis.Core/Models/Profile/PropertiesProfileElement.cs +++ b/src/Artemis.Core/Models/Profile/PropertiesProfileElement.cs @@ -1,11 +1,6 @@ -using System.Collections.Generic; -using Artemis.Storage.Entities.Profile; -using SkiaSharp; - -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public abstract class PropertiesProfileElement : ProfileElement { - } } \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/RenderProfileElement.cs b/src/Artemis.Core/Models/Profile/RenderProfileElement.cs index ed0022aa1..c3d5b01f3 100644 --- a/src/Artemis.Core/Models/Profile/RenderProfileElement.cs +++ b/src/Artemis.Core/Models/Profile/RenderProfileElement.cs @@ -2,18 +2,31 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Annotations; -using Artemis.Core.Models.Profile.Conditions; -using Artemis.Core.Models.Profile.LayerProperties; -using Artemis.Core.Plugins.LayerEffects; +using Artemis.Core.LayerEffects; +using Artemis.Core.Properties; using Artemis.Storage.Entities.Profile; using Artemis.Storage.Entities.Profile.Abstract; using SkiaSharp; -namespace Artemis.Core.Models.Profile +namespace Artemis.Core { public abstract class RenderProfileElement : ProfileElement { + /// + /// Returns a list of all keyframes on all properties and effects of this layer + /// + public virtual List GetAllKeyframes() + { + var keyframes = new List(); + foreach (var layerEffect in LayerEffects) + { + foreach (var baseLayerProperty in layerEffect.BaseProperties.GetAllLayerProperties()) + keyframes.AddRange(baseLayerProperty.BaseKeyframes); + } + + return keyframes; + } + protected void ApplyRenderElementDefaults() { MainSegmentLength = TimeSpan.FromSeconds(5); @@ -54,21 +67,6 @@ namespace Artemis.Core.Models.Profile } } - /// - /// Returns a list of all keyframes on all properties and effects of this layer - /// - public virtual List GetAllKeyframes() - { - var keyframes = new List(); - foreach (var layerEffect in LayerEffects) - { - foreach (var baseLayerProperty in layerEffect.BaseProperties.GetAllLayerProperties()) - keyframes.AddRange(baseLayerProperty.BaseKeyframes); - } - - return keyframes; - } - #region Properties private SKPath _path; @@ -215,7 +213,7 @@ namespace Artemis.Core.Models.Profile /// - /// Overrides the progress of the element + /// Overrides the progress of the element /// /// /// diff --git a/src/Artemis.Core/Models/Surface/ArtemisDevice.cs b/src/Artemis.Core/Models/Surface/ArtemisDevice.cs index 926032ca0..61e830a89 100644 --- a/src/Artemis.Core/Models/Surface/ArtemisDevice.cs +++ b/src/Artemis.Core/Models/Surface/ArtemisDevice.cs @@ -1,20 +1,18 @@ using System; using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins; using Artemis.Storage.Entities.Surface; using RGB.NET.Core; using SkiaSharp; using Stylet; -namespace Artemis.Core.Models.Surface +namespace Artemis.Core { public class ArtemisDevice : PropertyChangedBase { - private SKRect _renderRectangle; - private SKPath _renderPath; private ReadOnlyCollection _leds; + private SKPath _renderPath; + private SKRect _renderRectangle; internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface) { diff --git a/src/Artemis.Core/Models/Surface/ArtemisLed.cs b/src/Artemis.Core/Models/Surface/ArtemisLed.cs index cf2b89508..d4f8f0546 100644 --- a/src/Artemis.Core/Models/Surface/ArtemisLed.cs +++ b/src/Artemis.Core/Models/Surface/ArtemisLed.cs @@ -1,14 +1,13 @@ -using Artemis.Core.Extensions; -using RGB.NET.Core; +using RGB.NET.Core; using SkiaSharp; using Stylet; -namespace Artemis.Core.Models.Surface +namespace Artemis.Core { public class ArtemisLed : PropertyChangedBase { - private SKRect _renderRectangle; private SKRect _absoluteRenderRectangle; + private SKRect _renderRectangle; public ArtemisLed(Led led, ArtemisDevice device) { diff --git a/src/Artemis.Core/Models/Surface/ArtemisSurface.cs b/src/Artemis.Core/Models/Surface/ArtemisSurface.cs index 2e83611a3..3c0af4aec 100644 --- a/src/Artemis.Core/Models/Surface/ArtemisSurface.cs +++ b/src/Artemis.Core/Models/Surface/ArtemisSurface.cs @@ -5,14 +5,14 @@ using Artemis.Storage.Entities.Surface; using RGB.NET.Core; using Stylet; -namespace Artemis.Core.Models.Surface +namespace Artemis.Core { public class ArtemisSurface : PropertyChangedBase { - private double _scale; - private string _name; - private bool _isActive; private List _devices; + private bool _isActive; + private string _name; + private double _scale; internal ArtemisSurface(RGBSurface rgbSurface, string name, double scale) { diff --git a/src/Artemis.Core/Ninject/CoreModule.cs b/src/Artemis.Core/Ninject/CoreModule.cs index 67b09bc8e..28fe3bcf0 100644 --- a/src/Artemis.Core/Ninject/CoreModule.cs +++ b/src/Artemis.Core/Ninject/CoreModule.cs @@ -1,9 +1,5 @@ using System.IO; -using System.Security.AccessControl; -using System.Security.Principal; -using Artemis.Core.Exceptions; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using Artemis.Storage; using Artemis.Storage.Migrations.Interfaces; using Artemis.Storage.Repositories.Interfaces; @@ -15,8 +11,12 @@ using Serilog; namespace Artemis.Core.Ninject { + /// + /// The main of the Artemis Core that binds all services + /// public class CoreModule : NinjectModule { + /// public override void Load() { if (Kernel == null) diff --git a/src/Artemis.Core/Ninject/PluginSettingsProvider.cs b/src/Artemis.Core/Ninject/PluginSettingsProvider.cs index 1e8fc404f..ceaabd17a 100644 --- a/src/Artemis.Core/Ninject/PluginSettingsProvider.cs +++ b/src/Artemis.Core/Ninject/PluginSettingsProvider.cs @@ -1,8 +1,5 @@ using System.Linq; -using Artemis.Core.Exceptions; -using Artemis.Core.Plugins; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using Artemis.Storage.Repositories.Interfaces; using Ninject.Activation; @@ -31,8 +28,10 @@ namespace Artemis.Core.Ninject pluginInfo = _pluginService.GetPluginByAssembly(parentRequest.Service.Assembly)?.PluginInfo; // Fall back to assembly based detection if (pluginInfo == null) + { throw new ArtemisCoreException("PluginSettings can only be injected with the PluginInfo parameter provided " + "or into a class defined in a plugin assembly"); + } return new PluginSettings(pluginInfo, _pluginRepository); } diff --git a/src/Artemis.Core/Ninject/SettingsServiceProvider.cs b/src/Artemis.Core/Ninject/SettingsServiceProvider.cs index 1e1d8e094..e7f6c1f39 100644 --- a/src/Artemis.Core/Ninject/SettingsServiceProvider.cs +++ b/src/Artemis.Core/Ninject/SettingsServiceProvider.cs @@ -1,13 +1,10 @@ -using Artemis.Core.Plugins; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services; +using Artemis.Core.Services; using Ninject; using Ninject.Activation; namespace Artemis.Core.Ninject { - public class SettingsServiceProvider : Provider + internal class SettingsServiceProvider : Provider { private readonly SettingsService _instance; diff --git a/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelIgnoreAttribute.cs b/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelIgnoreAttribute.cs index e41d3db61..63a0003b8 100644 --- a/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelIgnoreAttribute.cs +++ b/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelIgnoreAttribute.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.DataModelExpansions.Attributes +namespace Artemis.Core.DataModelExpansions { public class DataModelIgnoreAttribute : Attribute { diff --git a/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelProperty.cs b/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelProperty.cs index 7428d5f3c..ee627a080 100644 --- a/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelProperty.cs +++ b/src/Artemis.Core/Plugins/DataModelExpansions/Attributes/DataModelProperty.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.DataModelExpansions.Attributes +namespace Artemis.Core.DataModelExpansions { [AttributeUsage(AttributeTargets.Property)] public class DataModelPropertyAttribute : Attribute diff --git a/src/Artemis.Core/Plugins/DataModelExpansions/DataModel.cs b/src/Artemis.Core/Plugins/DataModelExpansions/DataModel.cs index dd5e6e367..9edd2a6cc 100644 --- a/src/Artemis.Core/Plugins/DataModelExpansions/DataModel.cs +++ b/src/Artemis.Core/Plugins/DataModelExpansions/DataModel.cs @@ -4,12 +4,9 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Reflection; -using Artemis.Core.Exceptions; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; -using Artemis.Core.Plugins.DataModelExpansions.Internal; -using Artemis.Core.Plugins.Modules; +using Artemis.Core.Modules; -namespace Artemis.Core.Plugins.DataModelExpansions +namespace Artemis.Core.DataModelExpansions { public abstract class DataModel { diff --git a/src/Artemis.Core/Plugins/DataModelExpansions/DataModelExpansion.cs b/src/Artemis.Core/Plugins/DataModelExpansions/DataModelExpansion.cs index b6ec6d36c..8230e08f8 100644 --- a/src/Artemis.Core/Plugins/DataModelExpansions/DataModelExpansion.cs +++ b/src/Artemis.Core/Plugins/DataModelExpansions/DataModelExpansion.cs @@ -1,10 +1,8 @@ using System; using System.Linq; using System.Linq.Expressions; -using Artemis.Core.Plugins.DataModelExpansions.Internal; -using Artemis.Core.Utilities; -namespace Artemis.Core.Plugins.DataModelExpansions +namespace Artemis.Core.DataModelExpansions { /// /// Allows you to expand the application-wide datamodel @@ -32,7 +30,8 @@ namespace Artemis.Core.Plugins.DataModelExpansions } /// - /// 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) /// /// A lambda expression pointing to the property to stop ignoring public void ShowProperty(Expression> propertyLambda) diff --git a/src/Artemis.Core/Plugins/DataModelExpansions/Internal/BaseDataModelExpansion.cs b/src/Artemis.Core/Plugins/DataModelExpansions/Internal/BaseDataModelExpansion.cs index d292025f7..b1cb9a882 100644 --- a/src/Artemis.Core/Plugins/DataModelExpansions/Internal/BaseDataModelExpansion.cs +++ b/src/Artemis.Core/Plugins/DataModelExpansions/Internal/BaseDataModelExpansion.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Reflection; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; -namespace Artemis.Core.Plugins.DataModelExpansions.Internal +namespace Artemis.Core.DataModelExpansions { /// /// For internal use only, to implement your own layer property type, extend diff --git a/src/Artemis.Core/Plugins/DeviceProviders/DeviceProvider.cs b/src/Artemis.Core/Plugins/DeviceProviders/DeviceProvider.cs index 4444200c5..f34cdc30e 100644 --- a/src/Artemis.Core/Plugins/DeviceProviders/DeviceProvider.cs +++ b/src/Artemis.Core/Plugins/DeviceProviders/DeviceProvider.cs @@ -1,11 +1,10 @@ using System; using System.IO; -using Artemis.Core.Extensions; using Ninject; using RGB.NET.Core; using Serilog; -namespace Artemis.Core.Plugins.DeviceProviders +namespace Artemis.Core.DeviceProviders { /// /// diff --git a/src/Artemis.Core/Plugins/LayerBrushes/BrushConfigurationViewModel.cs b/src/Artemis.Core/Plugins/LayerBrushes/BrushConfigurationViewModel.cs index 00d510ad6..6d770e975 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/BrushConfigurationViewModel.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/BrushConfigurationViewModel.cs @@ -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 { diff --git a/src/Artemis.Core/Plugins/LayerBrushes/Internal/BaseLayerBrush.cs b/src/Artemis.Core/Plugins/LayerBrushes/Internal/BaseLayerBrush.cs index 9e9a825bc..117a7656e 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/Internal/BaseLayerBrush.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/Internal/BaseLayerBrush.cs @@ -1,11 +1,9 @@ using System; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using SkiaSharp; using Stylet; -namespace Artemis.Core.Plugins.LayerBrushes.Internal +namespace Artemis.Core.LayerBrushes { /// /// For internal use only, please use or or instead @@ -127,7 +125,7 @@ namespace Artemis.Core.Plugins.LayerBrushes.Internal Regular, /// - /// 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. /// RgbNet } diff --git a/src/Artemis.Core/Plugins/LayerBrushes/Internal/PropertiesLayerBrush.cs b/src/Artemis.Core/Plugins/LayerBrushes/Internal/PropertiesLayerBrush.cs index 3e68aeedc..52a2de9d6 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/Internal/PropertiesLayerBrush.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/Internal/PropertiesLayerBrush.cs @@ -1,9 +1,7 @@ using System; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; -namespace Artemis.Core.Plugins.LayerBrushes.Internal +namespace Artemis.Core.LayerBrushes { /// /// For internal use only, please use or or instead diff --git a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrush.cs b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrush.cs index f7a2b83c6..f1e75b77f 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrush.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrush.cs @@ -1,9 +1,7 @@ -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.LayerBrushes.Internal; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using SkiaSharp; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { public abstract class LayerBrush : PropertiesLayerBrush where T : LayerPropertyGroup { diff --git a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushConfigurationDialog.cs b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushConfigurationDialog.cs index 020eec55e..5074e8d02 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushConfigurationDialog.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushConfigurationDialog.cs @@ -1,7 +1,6 @@ using System; -using Artemis.Core.Plugins.LayerBrushes.Internal; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { /// public class LayerBrushConfigurationDialog : LayerBrushConfigurationDialog where T : BrushConfigurationViewModel diff --git a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushDescriptor.cs b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushDescriptor.cs index 447d2d3a8..685435646 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushDescriptor.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushDescriptor.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { /// /// A class that describes a layer brush diff --git a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushProvider.cs b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushProvider.cs index 57e1d5f84..8470cc57e 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushProvider.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/LayerBrushProvider.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Plugins.LayerBrushes.Internal; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { /// /// Allows you to create one or more s usable by profile layers. diff --git a/src/Artemis.Core/Plugins/LayerBrushes/PerLedLayerBrush.cs b/src/Artemis.Core/Plugins/LayerBrushes/PerLedLayerBrush.cs index 6a806fc31..13972ac87 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/PerLedLayerBrush.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/PerLedLayerBrush.cs @@ -1,10 +1,7 @@ -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.LayerBrushes.Internal; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using SkiaSharp; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { public abstract class PerLedLayerBrush : PropertiesLayerBrush where T : LayerPropertyGroup { diff --git a/src/Artemis.Core/Plugins/LayerBrushes/RgbNetLayerBrush.cs b/src/Artemis.Core/Plugins/LayerBrushes/RgbNetLayerBrush.cs index 1d43ca26f..1f270cf8e 100644 --- a/src/Artemis.Core/Plugins/LayerBrushes/RgbNetLayerBrush.cs +++ b/src/Artemis.Core/Plugins/LayerBrushes/RgbNetLayerBrush.cs @@ -1,13 +1,11 @@ using System; using System.Linq; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.LayerBrushes.Internal; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using RGB.NET.Core; using RGB.NET.Groups; using SkiaSharp; -namespace Artemis.Core.Plugins.LayerBrushes +namespace Artemis.Core.LayerBrushes { /// /// An RGB.NET brush that uses RGB.NET's per-LED rendering engine. diff --git a/src/Artemis.Core/Plugins/LayerEffects/EffectConfigurationViewModel.cs b/src/Artemis.Core/Plugins/LayerEffects/EffectConfigurationViewModel.cs index 388712638..e1dde9fe8 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/EffectConfigurationViewModel.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/EffectConfigurationViewModel.cs @@ -1,6 +1,6 @@ using Stylet; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { public abstract class EffectConfigurationViewModel : Screen { diff --git a/src/Artemis.Core/Plugins/LayerEffects/Internal/BaseLayerEffect.cs b/src/Artemis.Core/Plugins/LayerEffects/Internal/BaseLayerEffect.cs index 9223402a2..06b63c649 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/Internal/BaseLayerEffect.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/Internal/BaseLayerEffect.cs @@ -1,16 +1,16 @@ using System; -using Artemis.Core.Models.Profile; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; using SkiaSharp; using Stylet; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { /// /// For internal use only, please use instead /// public abstract class BaseLayerEffect : PropertyChangedBase, IDisposable { + private LayerEffectConfigurationDialog _configurationDialog; private LayerEffectDescriptor _descriptor; private bool _enabled; private Guid _entityId; @@ -18,7 +18,6 @@ namespace Artemis.Core.Plugins.LayerEffects private string _name; private int _order; private RenderProfileElement _profileElement; - private LayerEffectConfigurationDialog _configurationDialog; /// /// Gets the unique ID of this effect @@ -76,7 +75,7 @@ namespace Artemis.Core.Plugins.LayerEffects } /// - /// Gets the that registered this effect + /// Gets the that registered this effect /// public LayerEffectDescriptor Descriptor { diff --git a/src/Artemis.Core/Plugins/LayerEffects/LayerEffect.cs b/src/Artemis.Core/Plugins/LayerEffects/LayerEffect.cs index f15765ced..57db9e522 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/LayerEffect.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/LayerEffect.cs @@ -1,9 +1,7 @@ using System; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Services; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { public abstract class LayerEffect : BaseLayerEffect where T : LayerPropertyGroup { diff --git a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectConfigurationDialog.cs b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectConfigurationDialog.cs index 32cf0d42e..674d3897e 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectConfigurationDialog.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectConfigurationDialog.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { /// public class LayerEffectConfigurationDialog : LayerEffectConfigurationDialog where T : EffectConfigurationViewModel diff --git a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectDescriptor.cs b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectDescriptor.cs index 7f5d6e8c4..b3c1db3b5 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectDescriptor.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectDescriptor.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { /// /// A class that describes a layer effect diff --git a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectProvider.cs b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectProvider.cs index f68614cde..e28716ce9 100644 --- a/src/Artemis.Core/Plugins/LayerEffects/LayerEffectProvider.cs +++ b/src/Artemis.Core/Plugins/LayerEffects/LayerEffectProvider.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Artemis.Core.Plugins.Exceptions; -namespace Artemis.Core.Plugins.LayerEffects +namespace Artemis.Core.LayerEffects { /// /// Allows you to register one or more s usable by profile layers. @@ -13,7 +12,7 @@ namespace Artemis.Core.Plugins.LayerEffects private readonly List _layerEffectDescriptors; /// - /// Allows you to register one or more s usable by profile layers. + /// Allows you to register one or more s usable by profile layers. /// protected LayerEffectProvider() { diff --git a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/BooleanActivationRequirement.cs b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/BooleanActivationRequirement.cs index 7a9dddc12..0333d9303 100644 --- a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/BooleanActivationRequirement.cs +++ b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/BooleanActivationRequirement.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Plugins.Modules.ActivationRequirements +namespace Artemis.Core.Modules { /// /// Evaluates to true or false by returning the value of ActivationMet diff --git a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/IModuleActivationRequirement.cs b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/IModuleActivationRequirement.cs index 11528beb9..7df147b8b 100644 --- a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/IModuleActivationRequirement.cs +++ b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/IModuleActivationRequirement.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Plugins.Modules.ActivationRequirements +namespace Artemis.Core.Modules { /// /// Evaluates to true or false by checking requirements specific to the implementation diff --git a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/ProcessActivationRequirement.cs b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/ProcessActivationRequirement.cs index 1c226f1cc..28a3899c1 100644 --- a/src/Artemis.Core/Plugins/Modules/ActivationRequirements/ProcessActivationRequirement.cs +++ b/src/Artemis.Core/Plugins/Modules/ActivationRequirements/ProcessActivationRequirement.cs @@ -2,9 +2,8 @@ using System.Diagnostics; using System.IO; using System.Linq; -using Artemis.Core.Extensions; -namespace Artemis.Core.Plugins.Modules.ActivationRequirements +namespace Artemis.Core.Modules { /// /// Evaluates to true or false by checking if the specified process is running diff --git a/src/Artemis.Core/Plugins/Modules/Module.cs b/src/Artemis.Core/Plugins/Modules/Module.cs index 8a2420589..24a1fb3fd 100644 --- a/src/Artemis.Core/Plugins/Modules/Module.cs +++ b/src/Artemis.Core/Plugins/Modules/Module.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; -using Artemis.Core.Plugins.Modules.ActivationRequirements; +using Artemis.Core.DataModelExpansions; using Artemis.Storage.Entities.Module; using SkiaSharp; -namespace Artemis.Core.Plugins.Modules +namespace Artemis.Core.Modules { /// /// Allows you to add support for new games/applications while utilizing your own data model diff --git a/src/Artemis.Core/Plugins/Modules/ModuleTab.cs b/src/Artemis.Core/Plugins/Modules/ModuleTab.cs index 57f5985af..7c868b8bd 100644 --- a/src/Artemis.Core/Plugins/Modules/ModuleTab.cs +++ b/src/Artemis.Core/Plugins/Modules/ModuleTab.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins.Modules +namespace Artemis.Core.Modules { /// public class ModuleTab : ModuleTab where T : ModuleViewModel diff --git a/src/Artemis.Core/Plugins/Modules/ModuleViewModel.cs b/src/Artemis.Core/Plugins/Modules/ModuleViewModel.cs index df4220793..7aeed4311 100644 --- a/src/Artemis.Core/Plugins/Modules/ModuleViewModel.cs +++ b/src/Artemis.Core/Plugins/Modules/ModuleViewModel.cs @@ -1,14 +1,14 @@ using Stylet; -namespace Artemis.Core.Plugins.Modules +namespace Artemis.Core.Modules { /// - /// The base class for any view model that belongs to a module + /// The base class for any view model that belongs to a module /// public abstract class ModuleViewModel : Screen { /// - /// The base class for any view model that belongs to a module + /// The base class for any view model that belongs to a module /// /// The module this view model belongs to /// The name of the tab that's shown on the modules UI page @@ -19,7 +19,7 @@ namespace Artemis.Core.Plugins.Modules } /// - /// Gets the module this view model belongs to + /// Gets the module this view model belongs to /// public Module Module { get; } } diff --git a/src/Artemis.Core/Plugins/Modules/ProfileModule.cs b/src/Artemis.Core/Plugins/Modules/ProfileModule.cs index 18e53bd1e..96647abd9 100644 --- a/src/Artemis.Core/Plugins/Modules/ProfileModule.cs +++ b/src/Artemis.Core/Plugins/Modules/ProfileModule.cs @@ -5,16 +5,10 @@ using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Threading.Tasks; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; -using Artemis.Core.Plugins.DataModelExpansions.Internal; -using Artemis.Core.Utilities; +using Artemis.Core.DataModelExpansions; using SkiaSharp; -namespace Artemis.Core.Plugins.Modules +namespace Artemis.Core.Modules { /// /// Allows you to add support for new games/applications while utilizing Artemis' profile engine and your own data diff --git a/src/Artemis.Core/Plugins/Plugin.cs b/src/Artemis.Core/Plugins/Plugin.cs index e0773d604..d8f260b1b 100644 --- a/src/Artemis.Core/Plugins/Plugin.cs +++ b/src/Artemis.Core/Plugins/Plugin.cs @@ -1,8 +1,7 @@ using System; using System.Threading.Tasks; -using Artemis.Core.Plugins.Exceptions; -namespace Artemis.Core.Plugins +namespace Artemis.Core { /// /// This is the base plugin type, use the other interfaces such as Module to create plugins @@ -18,7 +17,7 @@ namespace Artemis.Core.Plugins /// Gets whether the plugin is enabled /// public bool Enabled { get; private set; } - + /// /// Gets or sets a configuration dialog for this plugin that is accessible in the UI under Settings > Plugins /// diff --git a/src/Artemis.Core/Plugins/PluginConfigurationDialog.cs b/src/Artemis.Core/Plugins/PluginConfigurationDialog.cs index 571c22471..d215a6ec3 100644 --- a/src/Artemis.Core/Plugins/PluginConfigurationDialog.cs +++ b/src/Artemis.Core/Plugins/PluginConfigurationDialog.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Plugins +namespace Artemis.Core { /// public class PluginConfigurationDialog : PluginConfigurationDialog where T : PluginConfigurationViewModel diff --git a/src/Artemis.Core/Plugins/PluginConfigurationViewModel.cs b/src/Artemis.Core/Plugins/PluginConfigurationViewModel.cs index 4f18c77e3..c1e1d521a 100644 --- a/src/Artemis.Core/Plugins/PluginConfigurationViewModel.cs +++ b/src/Artemis.Core/Plugins/PluginConfigurationViewModel.cs @@ -1,6 +1,6 @@ using Stylet; -namespace Artemis.Core.Plugins +namespace Artemis.Core { public abstract class PluginConfigurationViewModel : Screen { diff --git a/src/Artemis.Core/Plugins/PluginInfo.cs b/src/Artemis.Core/Plugins/PluginInfo.cs index 7848707c8..971658630 100644 --- a/src/Artemis.Core/Plugins/PluginInfo.cs +++ b/src/Artemis.Core/Plugins/PluginInfo.cs @@ -6,7 +6,7 @@ using McMaster.NETCore.Plugins; using Newtonsoft.Json; using Stylet; -namespace Artemis.Core.Plugins +namespace Artemis.Core { [JsonObject(MemberSerialization.OptIn)] public class PluginInfo : PropertyChangedBase diff --git a/src/Artemis.Core/Plugins/Settings/PluginSetting.cs b/src/Artemis.Core/Plugins/Settings/PluginSetting.cs index 5220c4d5d..31e66b849 100644 --- a/src/Artemis.Core/Plugins/Settings/PluginSetting.cs +++ b/src/Artemis.Core/Plugins/Settings/PluginSetting.cs @@ -4,7 +4,7 @@ using Artemis.Storage.Repositories.Interfaces; using Newtonsoft.Json; using Stylet; -namespace Artemis.Core.Plugins.Settings +namespace Artemis.Core { public class PluginSetting : PropertyChangedBase { diff --git a/src/Artemis.Core/Plugins/Settings/PluginSettings.cs b/src/Artemis.Core/Plugins/Settings/PluginSettings.cs index b145dd948..fd82b09c7 100644 --- a/src/Artemis.Core/Plugins/Settings/PluginSettings.cs +++ b/src/Artemis.Core/Plugins/Settings/PluginSettings.cs @@ -3,7 +3,7 @@ using Artemis.Storage.Entities.Plugins; using Artemis.Storage.Repositories.Interfaces; using Newtonsoft.Json; -namespace Artemis.Core.Plugins.Settings +namespace Artemis.Core { /// /// This contains all the settings for your plugin. To access a setting use . @@ -46,7 +46,7 @@ namespace Artemis.Core.Plugins.Settings } var pluginSetting = new PluginSetting(_pluginInfo, _pluginRepository, settingEntity); - + // This overrides null with the default value, I'm not sure if that's desirable because you // might expect something to go null and you might not // if (pluginSetting.Value == null && defaultValue != null) diff --git a/src/Artemis.Core/Properties/Annotations.cs b/src/Artemis.Core/Properties/Annotations.cs index c0469b60d..74ad7d4bc 100644 --- a/src/Artemis.Core/Properties/Annotations.cs +++ b/src/Artemis.Core/Properties/Annotations.cs @@ -32,7 +32,7 @@ using System; // ReSharper disable MemberCanBeProtected.Global // ReSharper disable InconsistentNaming -namespace Artemis.Core.Annotations +namespace Artemis.Core.Properties { /// /// Indicates that the value of the marked element could be null sometimes, diff --git a/src/Artemis.Core/RGB.NET/BitmapBrush.cs b/src/Artemis.Core/RGB.NET/BitmapBrush.cs index b413a3e9a..224cf93c7 100644 --- a/src/Artemis.Core/RGB.NET/BitmapBrush.cs +++ b/src/Artemis.Core/RGB.NET/BitmapBrush.cs @@ -1,20 +1,21 @@ using System; using System.Collections.Generic; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins.Settings; using RGB.NET.Core; using SkiaSharp; -namespace Artemis.Core.RGB.NET +namespace Artemis.Core { + /// + /// The RGB.NET brush Artemis uses to map the SkiaSharp bitmap to LEDs + /// public class BitmapBrush : AbstractDecoratable, IBrush, IDisposable { + private readonly object _disposeLock; private readonly PluginSetting _sampleSizeSetting; - private object _disposeLock; #region Constructors - public BitmapBrush(Scale scale, PluginSetting sampleSizeSetting) + internal BitmapBrush(Scale scale, PluginSetting sampleSizeSetting) { _sampleSizeSetting = sampleSizeSetting; Scale = scale; diff --git a/src/Artemis.Core/Resources/intro-profile.json b/src/Artemis.Core/Resources/intro-profile.json index ab5994505..44f7f5874 100644 --- a/src/Artemis.Core/Resources/intro-profile.json +++ b/src/Artemis.Core/Resources/intro-profile.json @@ -5,7 +5,8 @@ "Name": "Intro animation", "IsActive": true, "Folders": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.FolderEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.FolderEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.FolderEntity, Artemis.Storage", @@ -22,11 +23,13 @@ "DisplayContinuously": true, "AlwaysFinishTimeline": false, "LayerEffects": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "PropertyEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "ExpandedPropertyGroups": { @@ -37,7 +40,8 @@ "$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage", "BooleanOperator": 0, "Children": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -45,7 +49,8 @@ ] }, "Layers": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.LayerEntity, Artemis.Storage", @@ -55,7 +60,8 @@ "Name": "Noise", "Enabled": true, "Leds": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "Profile": null, @@ -66,11 +72,13 @@ "DisplayContinuously": false, "AlwaysFinishTimeline": false, "LayerEffects": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "PropertyEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", @@ -79,7 +87,8 @@ "Value": "1", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -90,7 +99,8 @@ "Value": "1", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -101,7 +111,8 @@ "Value": "3", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -112,7 +123,8 @@ "Value": "{\"BrushPluginGuid\":\"61cbbf01-8d69-4ede-a972-f3f269da66d9\",\"BrushType\":\"NoiseBrush\"}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -123,7 +135,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -134,7 +147,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -145,7 +159,8 @@ "Value": "{\"IsEmpty\":false,\"Width\":500.0,\"Height\":500.0}", "KeyframesEnabled": true, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage", @@ -171,7 +186,8 @@ "Value": "-45.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -182,7 +198,8 @@ "Value": "100.0", "KeyframesEnabled": true, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage", @@ -208,7 +225,8 @@ "Value": "1", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -219,7 +237,8 @@ "Value": "\"#ff009688\"", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -230,7 +249,8 @@ "Value": "\"#ff00ffe7\"", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -238,10 +258,12 @@ "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", "PluginGuid": "61cbbf01-8d69-4ede-a972-f3f269da66d9", "Path": "LayerBrush.GradientColor", - "Value": "{\"Stops\":[{\"Color\":\"#ff0b4a40\",\"Position\":0.0},{\"Color\":\"#ff00897c\",\"Position\":0.242},{\"Color\":\"#ffffffff\",\"Position\":1.0},{\"Color\":\"#ff00ffe6\",\"Position\":0.67391306}],\"Rotation\":0.0}", + "Value": + "{\"Stops\":[{\"Color\":\"#ff0b4a40\",\"Position\":0.0},{\"Color\":\"#ff00897c\",\"Position\":0.242},{\"Color\":\"#ffffffff\",\"Position\":1.0},{\"Color\":\"#ff00ffe6\",\"Position\":0.67391306}],\"Rotation\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -252,7 +274,8 @@ "Value": "{\"IsEmpty\":false,\"Width\":44.9,\"Height\":31.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -263,7 +286,8 @@ "Value": "228.5", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -274,7 +298,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -285,7 +310,8 @@ "Value": "25.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -301,7 +327,8 @@ "$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage", "BooleanOperator": 0, "Children": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -314,7 +341,8 @@ "Name": "Exploison", "Enabled": true, "Leds": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "Profile": null, @@ -325,11 +353,13 @@ "DisplayContinuously": false, "AlwaysFinishTimeline": false, "LayerEffects": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "PropertyEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", @@ -338,7 +368,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -349,7 +380,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -360,7 +392,8 @@ "Value": "3", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -371,7 +404,8 @@ "Value": "{\"BrushPluginGuid\":\"92a9d6ba-6f7a-4937-94d5-c1d715b4141a\",\"BrushType\":\"ColorBrush\"}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -382,7 +416,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -393,7 +428,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -404,7 +440,8 @@ "Value": "{\"IsEmpty\":false,\"Width\":110.03,\"Height\":340.37}", "KeyframesEnabled": true, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage", @@ -430,7 +467,8 @@ "Value": "0.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -441,7 +479,8 @@ "Value": "100.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -452,7 +491,8 @@ "Value": "2", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -463,7 +503,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -474,7 +515,8 @@ "Value": "\"#ffff0000\"", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -482,10 +524,12 @@ "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", "PluginGuid": "92a9d6ba-6f7a-4937-94d5-c1d715b4141a", "Path": "LayerBrush.Colors", - "Value": "{\"Stops\":[{\"Color\":\"#00ff0000\",\"Position\":0.0},{\"Color\":\"#ffff8800\",\"Position\":0.492},{\"Color\":\"#ffedff00\",\"Position\":0.905},{\"Color\":\"#00ff0000\",\"Position\":1.0}],\"Rotation\":0.0}", + "Value": + "{\"Stops\":[{\"Color\":\"#00ff0000\",\"Position\":0.0},{\"Color\":\"#ffff8800\",\"Position\":0.492},{\"Color\":\"#ffedff00\",\"Position\":0.905},{\"Color\":\"#00ff0000\",\"Position\":1.0}],\"Rotation\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -496,7 +540,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -507,7 +552,8 @@ "Value": "0.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -518,7 +564,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -529,7 +576,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -543,7 +591,8 @@ "$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage", "BooleanOperator": 0, "Children": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -556,7 +605,8 @@ "Name": "Background", "Enabled": true, "Leds": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LedEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "Profile": null, @@ -567,11 +617,13 @@ "DisplayContinuously": false, "AlwaysFinishTimeline": false, "LayerEffects": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.LayerEffectEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] }, "PropertyEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [ { "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", @@ -580,7 +632,8 @@ "Value": "1", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -591,7 +644,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -602,7 +656,8 @@ "Value": "3", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -613,7 +668,8 @@ "Value": "{\"BrushPluginGuid\":\"92a9d6ba-6f7a-4937-94d5-c1d715b4141a\",\"BrushType\":\"ColorBrush\"}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -624,7 +680,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -635,7 +692,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -646,7 +704,8 @@ "Value": "{\"IsEmpty\":false,\"Width\":100.0,\"Height\":100.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -657,7 +716,8 @@ "Value": "0.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -668,7 +728,8 @@ "Value": "100.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -679,7 +740,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -690,7 +752,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -701,7 +764,8 @@ "Value": "\"#ff000000\"", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -709,10 +773,12 @@ "$type": "Artemis.Storage.Entities.Profile.PropertyEntity, Artemis.Storage", "PluginGuid": "92a9d6ba-6f7a-4937-94d5-c1d715b4141a", "Path": "LayerBrush.Colors", - "Value": "{\"Stops\":[{\"Color\":\"#ffff0000\",\"Position\":0.0},{\"Color\":\"#ffff8800\",\"Position\":0.125},{\"Color\":\"#ffedff00\",\"Position\":0.25},{\"Color\":\"#ff65ff00\",\"Position\":0.375},{\"Color\":\"#ff00ff22\",\"Position\":0.5},{\"Color\":\"#ff00ffaa\",\"Position\":0.625},{\"Color\":\"#ff00cbff\",\"Position\":0.75},{\"Color\":\"#ff0043ff\",\"Position\":0.875},{\"Color\":\"#ffff0000\",\"Position\":1.0}],\"Rotation\":0.0}", + "Value": + "{\"Stops\":[{\"Color\":\"#ffff0000\",\"Position\":0.0},{\"Color\":\"#ffff8800\",\"Position\":0.125},{\"Color\":\"#ffedff00\",\"Position\":0.25},{\"Color\":\"#ff65ff00\",\"Position\":0.375},{\"Color\":\"#ff00ff22\",\"Position\":0.5},{\"Color\":\"#ff00ffaa\",\"Position\":0.625},{\"Color\":\"#ff00cbff\",\"Position\":0.75},{\"Color\":\"#ff0043ff\",\"Position\":0.875},{\"Color\":\"#ffff0000\",\"Position\":1.0}],\"Rotation\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -723,7 +789,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -734,7 +801,8 @@ "Value": "0.0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -745,7 +813,8 @@ "Value": "{\"IsEmpty\":true,\"Length\":0.0,\"LengthSquared\":0.0,\"X\":0.0,\"Y\":0.0}", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } }, @@ -756,7 +825,8 @@ "Value": "0", "KeyframesEnabled": false, "KeyframeEntities": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.KeyframeEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } @@ -772,7 +842,8 @@ "$type": "Artemis.Storage.Entities.Profile.DisplayConditionGroupEntity, Artemis.Storage", "BooleanOperator": 0, "Children": { - "$type": "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", + "$type": + "System.Collections.Generic.List`1[[Artemis.Storage.Entities.Profile.Abstract.DisplayConditionPartEntity, Artemis.Storage]], System.Private.CoreLib", "$values": [] } } diff --git a/src/Artemis.Core/Services/CoreService.cs b/src/Artemis.Core/Services/CoreService.cs index 030349563..955a5f12f 100644 --- a/src/Artemis.Core/Services/CoreService.cs +++ b/src/Artemis.Core/Services/CoreService.cs @@ -4,24 +4,16 @@ using System.Diagnostics; using System.Linq; using System.Reflection; using System.Threading.Tasks; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; +using Artemis.Core.DataModelExpansions; using Artemis.Core.JsonConverters; -using Artemis.Core.Models.Profile; using Artemis.Core.Ninject; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Plugins.DataModelExpansions.Internal; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Services.Storage.Interfaces; -using Artemis.Core.Utilities; using Artemis.Storage; using Newtonsoft.Json; using RGB.NET.Core; using Serilog; using Serilog.Events; using SkiaSharp; -using Module = Artemis.Core.Plugins.Modules.Module; +using Module = Artemis.Core.Modules.Module; namespace Artemis.Core.Services { @@ -38,8 +30,8 @@ namespace Artemis.Core.Services private readonly IRgbService _rgbService; private readonly ISurfaceService _surfaceService; private List _dataModelExpansions; - private List _modules; private IntroAnimation _introAnimation; + private List _modules; // ReSharper disable once UnusedParameter.Local - Storage migration service is injected early to ensure it runs before anything else public CoreService(ILogger logger, StorageMigrationService _, ISettingsService settingsService, IPluginService pluginService, @@ -99,6 +91,16 @@ namespace Artemis.Core.Services OnInitialized(); } + protected virtual void OnFrameRendering(FrameRenderingEventArgs e) + { + FrameRendering?.Invoke(this, e); + } + + protected virtual void OnFrameRendered(FrameRenderedEventArgs e) + { + FrameRendered?.Invoke(this, e); + } + private void PlayIntroAnimation() { FrameRendering += DrawOverlay; @@ -126,16 +128,6 @@ namespace Artemis.Core.Services }); } - protected virtual void OnFrameRendering(FrameRenderingEventArgs e) - { - FrameRendering?.Invoke(this, e); - } - - protected virtual void OnFrameRendered(FrameRenderedEventArgs e) - { - FrameRendered?.Invoke(this, e); - } - private void UpdatePluginCache() { _modules = _pluginService.GetPluginsOfType().Where(p => p.Enabled).ToList(); diff --git a/src/Artemis.Core/Services/DataBindingService.cs b/src/Artemis.Core/Services/DataBindingService.cs index c6d1f5e44..8a82ae864 100644 --- a/src/Artemis.Core/Services/DataBindingService.cs +++ b/src/Artemis.Core/Services/DataBindingService.cs @@ -1,11 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.DataBindings; -using Artemis.Core.Models.Profile.DataBindings.Modifiers; -using Artemis.Core.Plugins; -using Artemis.Core.Services.Interfaces; using Newtonsoft.Json; using Serilog; diff --git a/src/Artemis.Core/Services/DataModelService.cs b/src/Artemis.Core/Services/DataModelService.cs index e0ac571d4..8d5d8956d 100644 --- a/src/Artemis.Core/Services/DataModelService.cs +++ b/src/Artemis.Core/Services/DataModelService.cs @@ -1,18 +1,8 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.Conditions; -using Artemis.Core.Models.Profile.Conditions.Operators; -using Artemis.Core.Plugins; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Plugins.DataModelExpansions.Internal; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Modules; using Newtonsoft.Json; using Serilog; @@ -24,8 +14,8 @@ namespace Artemis.Core.Services internal class DataModelService : IDataModelService { private readonly List _dataModelExpansions; - private readonly IPluginService _pluginService; private readonly ILogger _logger; + private readonly IPluginService _pluginService; private readonly List _registeredConditionOperators; public DataModelService(IPluginService pluginService, ILogger logger) diff --git a/src/Artemis.Core/Services/DeviceService.cs b/src/Artemis.Core/Services/DeviceService.cs index 3929d5851..473c333cf 100644 --- a/src/Artemis.Core/Services/DeviceService.cs +++ b/src/Artemis.Core/Services/DeviceService.cs @@ -1,7 +1,4 @@ using System.Threading.Tasks; -using Artemis.Core.Events; -using Artemis.Core.Models.Surface; -using Artemis.Core.Services.Interfaces; using SkiaSharp; namespace Artemis.Core.Services diff --git a/src/Artemis.Core/Services/Interfaces/IArtemisService.cs b/src/Artemis.Core/Services/Interfaces/IArtemisService.cs index f002df680..07a49a208 100644 --- a/src/Artemis.Core/Services/Interfaces/IArtemisService.cs +++ b/src/Artemis.Core/Services/Interfaces/IArtemisService.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { /// /// A singleton service diff --git a/src/Artemis.Core/Services/Interfaces/ICoreService.cs b/src/Artemis.Core/Services/Interfaces/ICoreService.cs index 209a8b7b0..674db94ef 100644 --- a/src/Artemis.Core/Services/Interfaces/ICoreService.cs +++ b/src/Artemis.Core/Services/Interfaces/ICoreService.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.Threading.Tasks; -using Artemis.Core.Events; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { public interface ICoreService : IArtemisService, IDisposable { @@ -16,7 +14,7 @@ namespace Artemis.Core.Services.Interfaces /// The time the last frame took to render /// TimeSpan FrameTime { get; } - + /// /// Gets or sets whether modules are rendered each frame by calling their Render method /// diff --git a/src/Artemis.Core/Services/Interfaces/IDataBindingService.cs b/src/Artemis.Core/Services/Interfaces/IDataBindingService.cs index 1ac5018b9..8d9201383 100644 --- a/src/Artemis.Core/Services/Interfaces/IDataBindingService.cs +++ b/src/Artemis.Core/Services/Interfaces/IDataBindingService.cs @@ -1,12 +1,9 @@ using System; using System.Collections.Generic; -using Artemis.Core.Annotations; -using Artemis.Core.Models.Profile.DataBindings; -using Artemis.Core.Models.Profile.DataBindings.Modifiers; -using Artemis.Core.Plugins; +using Artemis.Core.Properties; using Newtonsoft.Json; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { public interface IDataBindingService : IArtemisService { diff --git a/src/Artemis.Core/Services/Interfaces/IDataModelService.cs b/src/Artemis.Core/Services/Interfaces/IDataModelService.cs index 512fc8710..7b2cb5582 100644 --- a/src/Artemis.Core/Services/Interfaces/IDataModelService.cs +++ b/src/Artemis.Core/Services/Interfaces/IDataModelService.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; -using Artemis.Core.Annotations; -using Artemis.Core.Models.Profile.Conditions; -using Artemis.Core.Plugins; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; +using Artemis.Core.Properties; using Newtonsoft.Json; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { public interface IDataModelService : IArtemisService { diff --git a/src/Artemis.Core/Services/Interfaces/IModuleService.cs b/src/Artemis.Core/Services/Interfaces/IModuleService.cs index 5d43bb646..aa61cd25c 100644 --- a/src/Artemis.Core/Services/Interfaces/IModuleService.cs +++ b/src/Artemis.Core/Services/Interfaces/IModuleService.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using Artemis.Core.Plugins.Modules; +using Artemis.Core.Modules; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { /// /// A service providing module activation functionality diff --git a/src/Artemis.Core/Services/Interfaces/IPluginService.cs b/src/Artemis.Core/Services/Interfaces/IPluginService.cs index 601803233..d975c28c8 100644 --- a/src/Artemis.Core/Services/Interfaces/IPluginService.cs +++ b/src/Artemis.Core/Services/Interfaces/IPluginService.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; using System.Reflection; -using Artemis.Core.Events; -using Artemis.Core.Plugins; using RGB.NET.Core; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { /// - /// A service providing plugin management + /// A service providing plugin management /// public interface IPluginService : IArtemisService, IDisposable { diff --git a/src/Artemis.Core/Services/Interfaces/IProtectedArtemisService.cs b/src/Artemis.Core/Services/Interfaces/IProtectedArtemisService.cs index 2f1828d92..62c49ddf1 100644 --- a/src/Artemis.Core/Services/Interfaces/IProtectedArtemisService.cs +++ b/src/Artemis.Core/Services/Interfaces/IProtectedArtemisService.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { /// /// A singleton service that cannot be used by plugins diff --git a/src/Artemis.Core/Services/Interfaces/IRenderElementService.cs b/src/Artemis.Core/Services/Interfaces/IRenderElementService.cs index b7e84fa0a..bbb760dcf 100644 --- a/src/Artemis.Core/Services/Interfaces/IRenderElementService.cs +++ b/src/Artemis.Core/Services/Interfaces/IRenderElementService.cs @@ -1,9 +1,7 @@ -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.LayerBrushes; -using Artemis.Core.Plugins.LayerBrushes.Internal; -using Artemis.Core.Plugins.LayerEffects; +using Artemis.Core.LayerBrushes; +using Artemis.Core.LayerEffects; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { public interface IRenderElementService : IArtemisService { @@ -17,13 +15,13 @@ namespace Artemis.Core.Services.Interfaces Layer CreateLayer(Profile profile, ProfileElement parent, string name); /// - /// Removes the currently active layer brush from the and deletes any settings + /// Removes the currently active layer brush from the and deletes any settings /// /// The layer to remove the active brush from void RemoveLayerBrush(Layer layer); /// - /// Deactivates the currently active layer brush from the but keeps all settings + /// Deactivates the currently active layer brush from the but keeps all settings /// /// The layer to deactivate the active brush on void DeactivateLayerBrush(Layer layer); diff --git a/src/Artemis.Core/Services/Interfaces/IRgbService.cs b/src/Artemis.Core/Services/Interfaces/IRgbService.cs index f30d42eed..5b78f6bfb 100644 --- a/src/Artemis.Core/Services/Interfaces/IRgbService.cs +++ b/src/Artemis.Core/Services/Interfaces/IRgbService.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using Artemis.Core.Events; -using Artemis.Core.RGB.NET; using RGB.NET.Core; -namespace Artemis.Core.Services.Interfaces +namespace Artemis.Core.Services { public interface IRgbService : IArtemisService { diff --git a/src/Artemis.Core/Services/ModuleService.cs b/src/Artemis.Core/Services/ModuleService.cs index 5cc6cb5e6..1b452497e 100644 --- a/src/Artemis.Core/Services/ModuleService.cs +++ b/src/Artemis.Core/Services/ModuleService.cs @@ -5,13 +5,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Timers; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Services.Storage.Interfaces; -using Artemis.Storage.Entities.Module; +using Artemis.Core.Modules; using Artemis.Storage.Repositories.Interfaces; using Serilog; using Timer = System.Timers.Timer; diff --git a/src/Artemis.Core/Services/PluginService.cs b/src/Artemis.Core/Services/PluginService.cs index e0865687c..a593a8fb3 100644 --- a/src/Artemis.Core/Services/PluginService.cs +++ b/src/Artemis.Core/Services/PluginService.cs @@ -3,14 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins; -using Artemis.Core.Plugins.DeviceProviders; -using Artemis.Core.Plugins.Exceptions; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Utilities; +using Artemis.Core.DeviceProviders; using Artemis.Storage.Entities.Plugins; using Artemis.Storage.Repositories.Interfaces; using McMaster.NETCore.Plugins; @@ -328,7 +321,7 @@ namespace Artemis.Core.Services _pluginRepository.SavePlugin(plugin.PluginInfo.PluginEntity); _logger.Debug("Shutting down for device provider disable {pluginInfo}", plugin.PluginInfo); - CurrentProcessUtilities.Shutdown(2, true); + ApplicationUtilities.Shutdown(2, true); return; } diff --git a/src/Artemis.Core/Services/RenderElementService.cs b/src/Artemis.Core/Services/RenderElementService.cs index c848bbe07..ec6901764 100644 --- a/src/Artemis.Core/Services/RenderElementService.cs +++ b/src/Artemis.Core/Services/RenderElementService.cs @@ -1,14 +1,7 @@ using System; -using System.Collections.Generic; using System.Linq; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Profile.Conditions; -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.Core.LayerBrushes; +using Artemis.Core.LayerEffects; using Ninject; using Serilog; @@ -16,10 +9,10 @@ namespace Artemis.Core.Services { internal class RenderElementService : IRenderElementService { + private readonly IDataModelService _dataModelService; private readonly IKernel _kernel; private readonly ILogger _logger; private readonly IPluginService _pluginService; - private readonly IDataModelService _dataModelService; public RenderElementService(IKernel kernel, ILogger logger, IPluginService pluginService, IDataModelService dataModelService) { @@ -160,7 +153,7 @@ namespace Artemis.Core.Services } catch (Exception e) { - _logger.Warning(e, $"Failed to init display conditions for {renderElement}"); + _logger.Warning(e, $"Failed to init display conditions for {renderElement}"); } } } diff --git a/src/Artemis.Core/Services/RgbService.cs b/src/Artemis.Core/Services/RgbService.cs index 9b8038c11..684c99493 100644 --- a/src/Artemis.Core/Services/RgbService.cs +++ b/src/Artemis.Core/Services/RgbService.cs @@ -1,10 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; -using Artemis.Core.Events; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.RGB.NET; -using Artemis.Core.Services.Interfaces; using RGB.NET.Core; using RGB.NET.Groups; using Serilog; @@ -67,10 +62,10 @@ namespace Artemis.Core.Services _logger.Warning("Device provider {deviceProvider} has no devices", deviceProvider.GetType().Name); return; } - + foreach (var surfaceDevice in deviceProvider.Devices) { - _logger.Debug("Device provider {deviceProvider} added {deviceName}", + _logger.Debug("Device provider {deviceProvider} added {deviceName}", deviceProvider.GetType().Name, surfaceDevice.DeviceInfo?.DeviceName); if (!_loadedDevices.Contains(surfaceDevice)) { diff --git a/src/Artemis.Core/Services/SettingsService.cs b/src/Artemis.Core/Services/SettingsService.cs index 25e5bc411..9e3d76496 100644 --- a/src/Artemis.Core/Services/SettingsService.cs +++ b/src/Artemis.Core/Services/SettingsService.cs @@ -1,6 +1,4 @@ -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services.Interfaces; -using Artemis.Storage.Repositories.Interfaces; +using Artemis.Storage.Repositories.Interfaces; namespace Artemis.Core.Services { diff --git a/src/Artemis.Core/Services/Storage/Interfaces/IProfileService.cs b/src/Artemis.Core/Services/Storage/Interfaces/IProfileService.cs index 00e0ddfed..ac2bd2d04 100644 --- a/src/Artemis.Core/Services/Storage/Interfaces/IProfileService.cs +++ b/src/Artemis.Core/Services/Storage/Interfaces/IProfileService.cs @@ -1,10 +1,8 @@ using System.Collections.Generic; using System.Threading.Tasks; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Services.Interfaces; +using Artemis.Core.Modules; -namespace Artemis.Core.Services.Storage.Interfaces +namespace Artemis.Core.Services { /// /// Provides access to profile storage and is responsible for activating default profiles @@ -56,7 +54,6 @@ namespace Artemis.Core.Services.Storage.Interfaces /// /// /// - Task ActivateLastProfileAnimated(ProfileModule profileModule); /// diff --git a/src/Artemis.Core/Services/Storage/Interfaces/ISurfaceService.cs b/src/Artemis.Core/Services/Storage/Interfaces/ISurfaceService.cs index d028f84d1..b49dc98d1 100644 --- a/src/Artemis.Core/Services/Storage/Interfaces/ISurfaceService.cs +++ b/src/Artemis.Core/Services/Storage/Interfaces/ISurfaceService.cs @@ -1,10 +1,7 @@ using System; using System.Collections.ObjectModel; -using Artemis.Core.Events; -using Artemis.Core.Models.Surface; -using Artemis.Core.Services.Interfaces; -namespace Artemis.Core.Services.Storage.Interfaces +namespace Artemis.Core.Services { public interface ISurfaceService : IArtemisService { diff --git a/src/Artemis.Core/Services/Storage/ProfileService.cs b/src/Artemis.Core/Services/Storage/ProfileService.cs index 88d6c5a12..70cefcf48 100644 --- a/src/Artemis.Core/Services/Storage/ProfileService.cs +++ b/src/Artemis.Core/Services/Storage/ProfileService.cs @@ -2,21 +2,15 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.LayerBrushes; -using Artemis.Core.Plugins.LayerEffects; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Services.Storage.Interfaces; +using Artemis.Core.LayerBrushes; +using Artemis.Core.LayerEffects; +using Artemis.Core.Modules; using Artemis.Storage.Entities.Profile; using Artemis.Storage.Repositories.Interfaces; using Newtonsoft.Json; using Serilog; -namespace Artemis.Core.Services.Storage +namespace Artemis.Core.Services { internal class ProfileService : IProfileService { @@ -101,8 +95,15 @@ namespace Artemis.Core.Services.Storage var profile = new Profile(profileDescriptor.ProfileModule, profileEntity); InstantiateProfile(profile); - void ActivatingProfileSurfaceUpdate(object sender, SurfaceConfigurationEventArgs e) => profile.PopulateLeds(e.Surface); - void ActivatingProfilePluginToggle(object sender, PluginEventArgs e) => InstantiateProfile(profile); + void ActivatingProfileSurfaceUpdate(object sender, SurfaceConfigurationEventArgs e) + { + profile.PopulateLeds(e.Surface); + } + + void ActivatingProfilePluginToggle(object sender, PluginEventArgs e) + { + InstantiateProfile(profile); + } // This could happen during activation so subscribe to it _pluginService.PluginEnabled += ActivatingProfilePluginToggle; diff --git a/src/Artemis.Core/Services/Storage/SurfaceService.cs b/src/Artemis.Core/Services/Storage/SurfaceService.cs index e108c6bb7..8d6a57758 100644 --- a/src/Artemis.Core/Services/Storage/SurfaceService.cs +++ b/src/Artemis.Core/Services/Storage/SurfaceService.cs @@ -2,18 +2,11 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Artemis.Core.Events; -using Artemis.Core.Exceptions; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.Settings; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Services.Storage.Interfaces; using Artemis.Storage.Repositories.Interfaces; using RGB.NET.Core; using Serilog; -namespace Artemis.Core.Services.Storage +namespace Artemis.Core.Services { public class SurfaceService : ISurfaceService { diff --git a/src/Artemis.Core/Utilities/CurrentProcessUtilities.cs b/src/Artemis.Core/Utilities/CurrentProcessUtilities.cs index 729299de4..5674cb888 100644 --- a/src/Artemis.Core/Utilities/CurrentProcessUtilities.cs +++ b/src/Artemis.Core/Utilities/CurrentProcessUtilities.cs @@ -2,22 +2,29 @@ using System.Windows; using Stylet; -namespace Artemis.Core.Utilities +namespace Artemis.Core { - public static class CurrentProcessUtilities + /// + /// Provides utilities to manage the application + /// + public static class ApplicationUtilities { - public static string GetCurrentLocation() - { - return Process.GetCurrentProcess().MainModule.FileName; - } - + /// + /// Attempts to gracefully shut down the application with a delayed kill to ensure the application shut down + /// + /// This is required because not all SDKs shut down properly, it is too unpredictable to just assume we can + /// gracefully shut down + /// + /// + /// The delay in seconds after which to kill the application + /// Whether or not to restart the application after shutdown public static void Shutdown(int delay, bool restart) { // Always kill the process after the delay has passed, with all the plugins a graceful shutdown cannot be guaranteed var arguments = "-Command \"& {Start-Sleep -s " + delay + "; (Get-Process 'Artemis.UI').kill()}"; // If restart is required, start the executable again after the process was killed if (restart) - arguments = "-Command \"& {Start-Sleep -s " + delay + "; (Get-Process 'Artemis.UI').kill(); Start-Process -FilePath '" + GetCurrentLocation() + "'}\""; + arguments = "-Command \"& {Start-Sleep -s " + delay + "; (Get-Process 'Artemis.UI').kill(); Start-Process -FilePath '" + Process.GetCurrentProcess().MainModule.FileName + "'}\""; var info = new ProcessStartInfo { @@ -31,5 +38,14 @@ namespace Artemis.Core.Utilities // Also attempt a graceful shutdown on the UI thread Execute.OnUIThread(() => Application.Current.Shutdown()); } + + /// + /// Gets the current application location + /// + /// + internal static string GetCurrentLocation() + { + return Process.GetCurrentProcess().MainModule.FileName; + } } } \ No newline at end of file diff --git a/src/Artemis.Core/Utilities/Easings.cs b/src/Artemis.Core/Utilities/Easings.cs index c568c2385..c60e7f115 100644 --- a/src/Artemis.Core/Utilities/Easings.cs +++ b/src/Artemis.Core/Utilities/Easings.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core.Utilities +namespace Artemis.Core { public static class Easings { diff --git a/src/Artemis.Core/Utilities/IntroAnimation.cs b/src/Artemis.Core/Utilities/IntroAnimation.cs index 9b5cc0127..6fd8fff60 100644 --- a/src/Artemis.Core/Utilities/IntroAnimation.cs +++ b/src/Artemis.Core/Utilities/IntroAnimation.cs @@ -1,17 +1,14 @@ using System; using System.IO; using System.Linq; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Services.Storage.Interfaces; +using Artemis.Core.Modules; +using Artemis.Core.Services; using Artemis.Storage.Entities.Profile; using Newtonsoft.Json; using Serilog; using SkiaSharp; -namespace Artemis.Core.Utilities +namespace Artemis.Core { internal class IntroAnimation { diff --git a/src/Artemis.Core/Utilities/ReflectionUtilities.cs b/src/Artemis.Core/Utilities/ReflectionUtilities.cs index ccc2e4a76..17be2320e 100644 --- a/src/Artemis.Core/Utilities/ReflectionUtilities.cs +++ b/src/Artemis.Core/Utilities/ReflectionUtilities.cs @@ -2,9 +2,9 @@ using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core.Utilities +namespace Artemis.Core { - public static class ReflectionUtilities + internal static class ReflectionUtilities { public static PropertyInfo GetPropertyInfo(TSource source, Expression> propertyLambda) { @@ -17,7 +17,7 @@ namespace Artemis.Core.Utilities var propInfo = member.Member as PropertyInfo; if (propInfo == null) throw new ArgumentException(string.Format("Expression '{0}' refers to a field, not a property.", propertyLambda)); - + return propInfo; } } diff --git a/src/Artemis.Storage/Entities/Plugins/PluginEntity.cs b/src/Artemis.Storage/Entities/Plugins/PluginEntity.cs index b81a93152..65b84733f 100644 --- a/src/Artemis.Storage/Entities/Plugins/PluginEntity.cs +++ b/src/Artemis.Storage/Entities/Plugins/PluginEntity.cs @@ -1,6 +1,4 @@ using System; -using LiteDB; -using Newtonsoft.Json; namespace Artemis.Storage.Entities.Plugins { diff --git a/src/Artemis.Storage/Entities/Profile/Conditions/DisplayConditionListPredicateEntity.cs b/src/Artemis.Storage/Entities/Profile/Conditions/DisplayConditionListPredicateEntity.cs index 8a2521389..67c59027f 100644 --- a/src/Artemis.Storage/Entities/Profile/Conditions/DisplayConditionListPredicateEntity.cs +++ b/src/Artemis.Storage/Entities/Profile/Conditions/DisplayConditionListPredicateEntity.cs @@ -11,7 +11,9 @@ namespace Artemis.Storage.Entities.Profile.Conditions public string ListPropertyPath { get; set; } public string LeftPropertyPath { get; set; } + public string RightPropertyPath { get; set; } + // Stored as a string to be able to control serialization and deserialization ourselves public string RightStaticValue { get; set; } diff --git a/src/Artemis.Storage/Entities/Profile/LayerEntity.cs b/src/Artemis.Storage/Entities/Profile/LayerEntity.cs index df72c7d27..9b8f447e4 100644 --- a/src/Artemis.Storage/Entities/Profile/LayerEntity.cs +++ b/src/Artemis.Storage/Entities/Profile/LayerEntity.cs @@ -23,7 +23,7 @@ namespace Artemis.Storage.Entities.Profile public bool Enabled { get; set; } public List Leds { get; set; } - + [BsonRef("ProfileEntity")] public ProfileEntity Profile { get; set; } diff --git a/src/Artemis.Storage/Migrations/M2ProfileEntitiesEnabledMigration.cs b/src/Artemis.Storage/Migrations/M2ProfileEntitiesEnabledMigration.cs index 836362c57..8a0c809a9 100644 --- a/src/Artemis.Storage/Migrations/M2ProfileEntitiesEnabledMigration.cs +++ b/src/Artemis.Storage/Migrations/M2ProfileEntitiesEnabledMigration.cs @@ -16,7 +16,7 @@ namespace Artemis.Storage.Migrations foreach (var profileEntityFolder in profileEntity.Folders) { profileEntityFolder.Enabled = true; - foreach (var layerEffectEntity in profileEntityFolder.LayerEffects) + foreach (var layerEffectEntity in profileEntityFolder.LayerEffects) layerEffectEntity.Enabled = true; } diff --git a/src/Artemis.Storage/Migrations/M4ProfileSegments.cs b/src/Artemis.Storage/Migrations/M4ProfileSegments.cs index 9a99933da..144d77e9b 100644 --- a/src/Artemis.Storage/Migrations/M4ProfileSegments.cs +++ b/src/Artemis.Storage/Migrations/M4ProfileSegments.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Runtime.InteropServices; using Artemis.Storage.Entities.Profile; using Artemis.Storage.Migrations.Interfaces; using LiteDB; @@ -20,7 +19,7 @@ namespace Artemis.Storage.Migrations { if (folder.PropertyEntities.Any(p => p.KeyframeEntities.Any())) folder.MainSegmentLength = folder.PropertyEntities.Where(p => p.KeyframeEntities.Any()).Max(p => p.KeyframeEntities.Max(k => k.Position)); - if (folder.MainSegmentLength == TimeSpan.Zero) + if (folder.MainSegmentLength == TimeSpan.Zero) folder.MainSegmentLength = TimeSpan.FromSeconds(5); folder.DisplayContinuously = true; diff --git a/src/Artemis.Storage/Repositories/PluginRepository.cs b/src/Artemis.Storage/Repositories/PluginRepository.cs index d31f33a31..7d0f79652 100644 --- a/src/Artemis.Storage/Repositories/PluginRepository.cs +++ b/src/Artemis.Storage/Repositories/PluginRepository.cs @@ -12,7 +12,7 @@ namespace Artemis.Storage.Repositories internal PluginRepository(LiteRepository repository) { _repository = repository; - + _repository.Database.GetCollection().EnsureIndex(s => new {s.Name, s.PluginGuid}, true); } diff --git a/src/Artemis.UI.Shared/AnimationTimeline/BrushAnimation.cs b/src/Artemis.UI.Shared/AnimationTimeline/BrushAnimation.cs deleted file mode 100644 index 094243472..000000000 --- a/src/Artemis.UI.Shared/AnimationTimeline/BrushAnimation.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; -using System.Windows.Media.Animation; - -namespace Artemis.UI.Shared.AnimationTimeline -{ - public class BrushAnimation : System.Windows.Media.Animation.AnimationTimeline - { - public static readonly DependencyProperty FromProperty = - DependencyProperty.Register("From", typeof(Brush), typeof(BrushAnimation)); - - public static readonly DependencyProperty ToProperty = - DependencyProperty.Register("To", typeof(Brush), typeof(BrushAnimation)); - - public override Type TargetPropertyType => typeof(Brush); - - //we must define From and To, AnimationTimeline does not have this properties - public Brush From - { - get => (Brush) GetValue(FromProperty); - set => SetValue(FromProperty, value); - } - - public Brush To - { - get => (Brush) GetValue(ToProperty); - set => SetValue(ToProperty, value); - } - - public override object GetCurrentValue(object defaultOriginValue, - object defaultDestinationValue, - AnimationClock animationClock) - { - return GetCurrentValue(defaultOriginValue as Brush, - defaultDestinationValue as Brush, - animationClock); - } - - public object GetCurrentValue(Brush defaultOriginValue, - Brush defaultDestinationValue, - AnimationClock animationClock) - { - if (!animationClock.CurrentProgress.HasValue) - return Brushes.Transparent; - - //use the standard values if From and To are not set - //(it is the value of the given property) - defaultOriginValue = From ?? defaultOriginValue; - defaultDestinationValue = To ?? defaultDestinationValue; - - if (animationClock.CurrentProgress.Value == 0) - return defaultOriginValue; - if (animationClock.CurrentProgress.Value == 1) - return defaultDestinationValue; - - return new VisualBrush(new Border - { - Width = 1, - Height = 1, - Background = defaultOriginValue, - Child = new Border - { - Background = defaultDestinationValue, - Opacity = animationClock.CurrentProgress.Value - } - }); - } - - protected override Freezable CreateInstanceCore() - { - return new BrushAnimation(); - } - } -} \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj.DotSettings b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj.DotSettings new file mode 100644 index 000000000..82d8ff190 --- /dev/null +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj.DotSettings @@ -0,0 +1,14 @@ + + True + True + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Behaviors/PutCursorAtEndTextBoxBehavior.cs b/src/Artemis.UI.Shared/Behaviors/PutCursorAtEndTextBoxBehavior.cs index b564ccb87..011330894 100644 --- a/src/Artemis.UI.Shared/Behaviors/PutCursorAtEndTextBoxBehavior.cs +++ b/src/Artemis.UI.Shared/Behaviors/PutCursorAtEndTextBoxBehavior.cs @@ -2,7 +2,7 @@ using System.Windows.Controls; using Microsoft.Xaml.Behaviors; -namespace Artemis.UI.Shared.Behaviors +namespace Artemis.UI.Shared { public class PutCursorAtEndTextBoxBehavior : Behavior { diff --git a/src/Artemis.UI.Shared/Controls/ColorPicker.xaml b/src/Artemis.UI.Shared/Controls/ColorPicker.xaml index 26b21db45..666924607 100644 --- a/src/Artemis.UI.Shared/Controls/ColorPicker.xaml +++ b/src/Artemis.UI.Shared/Controls/ColorPicker.xaml @@ -4,7 +4,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters" x:Class="Artemis.UI.Shared.Controls.ColorPicker" + xmlns:shared="clr-namespace:Artemis.UI.Shared" + x:Class="Artemis.UI.Shared.ColorPicker" mc:Ignorable="d" d:DesignHeight="101.848" d:DesignWidth="242.956"> @@ -13,8 +14,8 @@ - - + + /// Interaction logic for ColorPicker.xaml diff --git a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs index a61dd5561..94ae68216 100644 --- a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs +++ b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs @@ -8,18 +8,30 @@ using System.Windows.Controls; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Threading; -using Artemis.Core.Models.Surface; +using Artemis.Core; -namespace Artemis.UI.Shared.Controls +namespace Artemis.UI.Shared { + /// + /// Visualizes an with optional per-LED colors + /// public class DeviceVisualizer : FrameworkElement, IDisposable { + /// + /// The device to visualize + /// public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register(nameof(Device), typeof(ArtemisDevice), typeof(DeviceVisualizer), new FrameworkPropertyMetadata(default(ArtemisDevice), FrameworkPropertyMetadataOptions.AffectsRender, DevicePropertyChangedCallback)); + /// + /// Whether or not to show per-LED colors + /// public static readonly DependencyProperty ShowColorsProperty = DependencyProperty.Register(nameof(ShowColors), typeof(bool), typeof(DeviceVisualizer), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsRender, ShowColorsPropertyChangedCallback)); + /// + /// A list of LEDs to highlight + /// public static readonly DependencyProperty HighlightedLedsProperty = DependencyProperty.Register(nameof(HighlightedLeds), typeof(IEnumerable), typeof(DeviceVisualizer), new FrameworkPropertyMetadata(default(IEnumerable))); @@ -29,6 +41,9 @@ namespace Artemis.UI.Shared.Controls private BitmapImage _deviceImage; private ArtemisDevice _oldDevice; + /// + /// Creates a new instance of the class + /// public DeviceVisualizer() { _backingStore = new DrawingGroup(); @@ -42,44 +57,40 @@ namespace Artemis.UI.Shared.Controls Unloaded += OnUnloaded; } + /// + /// Gets or sets the device to visualize + /// public ArtemisDevice Device { get => (ArtemisDevice) GetValue(DeviceProperty); set => SetValue(DeviceProperty, value); } + /// + /// Gets or sets whether or not to show per-LED colors + /// public bool ShowColors { get => (bool) GetValue(ShowColorsProperty); set => SetValue(ShowColorsProperty, value); } + /// + /// Gets or sets a list of LEDs to highlight + /// public IEnumerable HighlightedLeds { get => (IEnumerable) GetValue(HighlightedLedsProperty); set => SetValue(HighlightedLedsProperty, value); } + /// public void Dispose() { _timer.Stop(); } - public static Size ResizeKeepAspect(Size src, double maxWidth, double maxHeight) - { - double scale; - if (maxWidth == double.PositiveInfinity && maxHeight != double.PositiveInfinity) - scale = maxHeight / src.Height; - else if (maxWidth != double.PositiveInfinity && maxHeight == double.PositiveInfinity) - scale = maxWidth / src.Width; - else if (maxWidth == double.PositiveInfinity && maxHeight == double.PositiveInfinity) - return src; - - scale = Math.Min(maxWidth / src.Width, maxHeight / src.Height); - - return new Size(src.Width * scale, src.Height * scale); - } - + /// protected override void OnRender(DrawingContext drawingContext) { if (Device == null) @@ -118,6 +129,32 @@ namespace Artemis.UI.Shared.Controls drawingContext.DrawDrawing(_backingStore); } + /// + protected override Size MeasureOverride(Size availableSize) + { + if (Device == null) + return Size.Empty; + + var deviceSize = MeasureDevice(); + return ResizeKeepAspect(deviceSize, availableSize.Width, availableSize.Height); + } + + private static Size ResizeKeepAspect(Size src, double maxWidth, double maxHeight) + { + double scale; + // ?? + if (double.IsPositiveInfinity(maxWidth) && !double.IsPositiveInfinity(maxHeight)) + scale = maxHeight / src.Height; + else if (!double.IsPositiveInfinity(maxWidth) && double.IsPositiveInfinity(maxHeight)) + scale = maxWidth / src.Width; + else if (double.IsPositiveInfinity(maxWidth) && double.IsPositiveInfinity(maxHeight)) + return src; + + scale = Math.Min(maxWidth / src.Width, maxHeight / src.Height); + + return new Size(src.Width * scale, src.Height * scale); + } + private Size MeasureDevice() { if (Device == null) @@ -129,15 +166,6 @@ namespace Artemis.UI.Shared.Controls return rotationRect.Size; } - protected override Size MeasureOverride(Size availableSize) - { - if (Device == null) - return Size.Empty; - - var deviceSize = MeasureDevice(); - return ResizeKeepAspect(deviceSize, availableSize.Width, availableSize.Height); - } - private void OnUnloaded(object sender, RoutedEventArgs e) { _timer.Stop(); diff --git a/src/Artemis.UI.Shared/Controls/DeviceVisualizerLed.cs b/src/Artemis.UI.Shared/Controls/DeviceVisualizerLed.cs index 231d81237..a607d40c2 100644 --- a/src/Artemis.UI.Shared/Controls/DeviceVisualizerLed.cs +++ b/src/Artemis.UI.Shared/Controls/DeviceVisualizerLed.cs @@ -3,11 +3,11 @@ using System.IO; using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; -using Artemis.Core.Models.Surface; +using Artemis.Core; using RGB.NET.Core; using Color = System.Windows.Media.Color; -namespace Artemis.UI.Shared.Controls +namespace Artemis.UI.Shared { internal class DeviceVisualizerLed { @@ -69,7 +69,7 @@ namespace Artemis.UI.Shared.Controls // Create transparent pixels covering the entire LedRect so the image size matched the LedRect size drawingContext.DrawRectangle(new SolidColorBrush(Colors.Transparent), null, LedRect); // Translate to the top-left of the LedRect - drawingContext.PushTransform(new TranslateTransform(LedRect.X , LedRect.Y)); + drawingContext.PushTransform(new TranslateTransform(LedRect.X, LedRect.Y)); // Render the LED geometry drawingContext.DrawGeometry(fillBrush, new Pen(penBrush, 1) {LineJoin = PenLineJoin.Round}, DisplayGeometry.GetOutlinedPathGeometry()); // Restore the drawing context diff --git a/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml b/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml index a2c9b12ed..9f0133e3c 100644 --- a/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml +++ b/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml @@ -1,10 +1,8 @@ - @@ -19,7 +17,7 @@ @@ -50,6 +48,6 @@ KeyDown="InputKeyDown" Visibility="Collapsed" RequestBringIntoView="Input_OnRequestBringIntoView" - PreviewTextInput="Input_PreviewTextInput"/> + PreviewTextInput="Input_PreviewTextInput" /> \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml.cs b/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml.cs index 3cc5d6fff..b56f551ce 100644 --- a/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml.cs +++ b/src/Artemis.UI.Shared/Controls/DraggableFloat.xaml.cs @@ -7,7 +7,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; -namespace Artemis.UI.Shared.Controls +namespace Artemis.UI.Shared { /// /// Interaction logic for DraggableFloat.xaml diff --git a/src/Artemis.UI.Shared/Controls/GradientPicker.xaml b/src/Artemis.UI.Shared/Controls/GradientPicker.xaml index d98c20444..e9f083456 100644 --- a/src/Artemis.UI.Shared/Controls/GradientPicker.xaml +++ b/src/Artemis.UI.Shared/Controls/GradientPicker.xaml @@ -1,14 +1,14 @@ - - + diff --git a/src/Artemis.UI.Shared/Controls/GradientPicker.xaml.cs b/src/Artemis.UI.Shared/Controls/GradientPicker.xaml.cs index 2ff262c80..c1ee8b929 100644 --- a/src/Artemis.UI.Shared/Controls/GradientPicker.xaml.cs +++ b/src/Artemis.UI.Shared/Controls/GradientPicker.xaml.cs @@ -4,12 +4,12 @@ using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using Artemis.Core.Models.Profile.Colors; -using Artemis.UI.Shared.Annotations; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.Core; +using Artemis.UI.Shared.Properties; +using Artemis.UI.Shared.Services; using Stylet; -namespace Artemis.UI.Shared.Controls +namespace Artemis.UI.Shared { /// /// Interaction logic for GradientPicker.xaml diff --git a/src/Artemis.UI.Shared/Converters/ColorGradientToGradientStopsConverter.cs b/src/Artemis.UI.Shared/Converters/ColorGradientToGradientStopsConverter.cs index 0b42719f2..3188285e2 100644 --- a/src/Artemis.UI.Shared/Converters/ColorGradientToGradientStopsConverter.cs +++ b/src/Artemis.UI.Shared/Converters/ColorGradientToGradientStopsConverter.cs @@ -3,11 +3,11 @@ using System.Globalization; using System.Linq; using System.Windows.Data; using System.Windows.Media; -using Artemis.Core.Models.Profile.Colors; +using Artemis.Core; using SkiaSharp; using Stylet; -namespace Artemis.UI.Shared.Converters +namespace Artemis.UI.Shared { /// /// @@ -17,6 +17,7 @@ namespace Artemis.UI.Shared.Converters [ValueConversion(typeof(BindableCollection), typeof(GradientStopCollection))] public class ColorGradientToGradientStopsConverter : IValueConverter { + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var colorGradients = (BindableCollection) value; @@ -29,6 +30,7 @@ namespace Artemis.UI.Shared.Converters return collection; } + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { var collection = (GradientStopCollection) value; diff --git a/src/Artemis.UI.Shared/Converters/ColorToSKColorConverter.cs b/src/Artemis.UI.Shared/Converters/ColorToSKColorConverter.cs index 603c5a174..035b5d3f5 100644 --- a/src/Artemis.UI.Shared/Converters/ColorToSKColorConverter.cs +++ b/src/Artemis.UI.Shared/Converters/ColorToSKColorConverter.cs @@ -4,7 +4,7 @@ using System.Windows.Data; using System.Windows.Media; using SkiaSharp; -namespace Artemis.UI.Shared.Converters +namespace Artemis.UI.Shared { /// /// @@ -13,12 +13,14 @@ namespace Artemis.UI.Shared.Converters [ValueConversion(typeof(Color), typeof(SKColor))] public class SKColorToColorConverter : IValueConverter { + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var skColor = (SKColor) value; return Color.FromArgb(skColor.Alpha, skColor.Red, skColor.Green, skColor.Blue); } + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { var color = (Color) value; diff --git a/src/Artemis.UI.Shared/Converters/ColorToSolidColorConverter.cs b/src/Artemis.UI.Shared/Converters/ColorToSolidColorConverter.cs index ff06f1cfd..1e5ddd7b0 100644 --- a/src/Artemis.UI.Shared/Converters/ColorToSolidColorConverter.cs +++ b/src/Artemis.UI.Shared/Converters/ColorToSolidColorConverter.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Windows.Data; using System.Windows.Media; -namespace Artemis.UI.Shared.Converters +namespace Artemis.UI.Shared { /// /// @@ -13,12 +13,14 @@ namespace Artemis.UI.Shared.Converters [ValueConversion(typeof(Color), typeof(string))] public class ColorToSolidColorConverter : IValueConverter { + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var color = (Color) value; return Color.FromRgb(color.R, color.G, color.B); } + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); diff --git a/src/Artemis.UI.Shared/Converters/ColorToStringConverter.cs b/src/Artemis.UI.Shared/Converters/ColorToStringConverter.cs index 6e431160b..0d9a9ccd7 100644 --- a/src/Artemis.UI.Shared/Converters/ColorToStringConverter.cs +++ b/src/Artemis.UI.Shared/Converters/ColorToStringConverter.cs @@ -3,7 +3,7 @@ using System.Globalization; using System.Windows.Data; using System.Windows.Media; -namespace Artemis.UI.Shared.Converters +namespace Artemis.UI.Shared { /// /// @@ -12,11 +12,13 @@ namespace Artemis.UI.Shared.Converters [ValueConversion(typeof(Color), typeof(string))] public class ColorToStringConverter : IValueConverter { + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value?.ToString(); } + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { try diff --git a/src/Artemis.UI.Shared/Converters/SKColorToStringConverter.cs b/src/Artemis.UI.Shared/Converters/SKColorToStringConverter.cs index 8bd81154b..fce6c3fde 100644 --- a/src/Artemis.UI.Shared/Converters/SKColorToStringConverter.cs +++ b/src/Artemis.UI.Shared/Converters/SKColorToStringConverter.cs @@ -4,26 +4,28 @@ using System.Windows.Data; using System.Windows.Media; using SkiaSharp; -namespace Artemis.UI.Shared.Converters +namespace Artemis.UI.Shared { /// /// - /// Converts into . + /// Converts into . /// [ValueConversion(typeof(Color), typeof(string))] public class SKColorToStringConverter : IValueConverter { + /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value?.ToString(); } + /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (string.IsNullOrWhiteSpace((string) value)) return SKColor.Empty; - return SKColor.TryParse((string)value, out var color) ? color : SKColor.Empty; + return SKColor.TryParse((string) value, out var color) ? color : SKColor.Empty; } } } \ No newline at end of file diff --git a/src/Artemis.UI.Shared/DataModelVisualization/DataModelDisplayViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/DataModelDisplayViewModel.cs index 0f91099df..7a5996ca3 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/DataModelDisplayViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/DataModelDisplayViewModel.cs @@ -1,6 +1,6 @@ using Stylet; -namespace Artemis.UI.Shared.DataModelVisualization +namespace Artemis.UI.Shared { public abstract class DataModelDisplayViewModel : DataModelDisplayViewModel { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs index 947381da9..b25dd3614 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/DataModelInputViewModel.cs @@ -4,10 +4,10 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Data; using System.Windows.Input; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; +using Artemis.Core.DataModelExpansions; using Stylet; -namespace Artemis.UI.Shared.DataModelVisualization +namespace Artemis.UI.Shared { public abstract class DataModelInputViewModel : DataModelInputViewModel { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/DataModelVisualizationRegistration.cs b/src/Artemis.UI.Shared/DataModelVisualization/DataModelVisualizationRegistration.cs index 20031e3a4..ef29c8cf7 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/DataModelVisualizationRegistration.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/DataModelVisualizationRegistration.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; using Artemis.Core; -using Artemis.Core.Plugins; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; -namespace Artemis.UI.Shared.DataModelVisualization +namespace Artemis.UI.Shared { public class DataModelVisualizationRegistration { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertiesViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertiesViewModel.cs index 2dbb222d3..47ee8f444 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertiesViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertiesViewModel.cs @@ -1,11 +1,10 @@ using System; using System.Linq; using System.Reflection; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public class DataModelListPropertiesViewModel : DataModelPropertiesViewModel { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertyViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertyViewModel.cs index 95f8f81fb..2d3c7292b 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertyViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListPropertyViewModel.cs @@ -1,11 +1,10 @@ using System; using System.Linq; using System.Reflection; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public class DataModelListPropertyViewModel : DataModelPropertyViewModel { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListViewModel.cs index 2c18777b1..a49e17d00 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelListViewModel.cs @@ -1,13 +1,12 @@ using System; using System.Collections; using System.Reflection; -using Artemis.Core.Extensions; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; using Stylet; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public class DataModelListViewModel : DataModelVisualizationViewModel { @@ -50,7 +49,7 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared if (viewModel is DataModelListPropertyViewModel dataModelListPropertyViewModel) { dataModelListPropertyViewModel.DisplayValue = Activator.CreateInstance(dataModelListPropertyViewModel.ListType); - var wrapper = new DataModelPropertiesViewModel(null,null,null); + var wrapper = new DataModelPropertiesViewModel(null, null, null); wrapper.Children.Add(dataModelListPropertyViewModel); return wrapper; } diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertiesViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertiesViewModel.cs index 7ebe5b4b4..ec6d02246 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertiesViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertiesViewModel.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public class DataModelPropertiesViewModel : DataModelVisualizationViewModel { @@ -31,6 +30,11 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared return Parent.IsRootViewModel ? DataModel : base.GetCurrentValue(); } + protected int GetChildDepth() + { + return PropertyDescription != null && !PropertyDescription.ResetsDepth ? Depth + 1 : 1; + } + private void PopulateProperties(IDataModelUIService dataModelUIService) { if (IsRootViewModel) @@ -57,10 +61,5 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared Children.Remove(dataModelVisualizationViewModel); } } - - protected int GetChildDepth() - { - return PropertyDescription != null && !PropertyDescription.ResetsDepth ? Depth + 1 : 1; - } } } \ No newline at end of file diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertyViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertyViewModel.cs index 2c2fad9a9..729e3fe67 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertyViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelPropertyViewModel.cs @@ -1,10 +1,9 @@ using System.Linq; using System.Reflection; -using Artemis.Core.Plugins.DataModelExpansions; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public class DataModelPropertyViewModel : DataModelVisualizationViewModel { diff --git a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelVisualizationViewModel.cs b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelVisualizationViewModel.cs index 2e095d188..fd5993b27 100644 --- a/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelVisualizationViewModel.cs +++ b/src/Artemis.UI.Shared/DataModelVisualization/Shared/DataModelVisualizationViewModel.cs @@ -1,20 +1,14 @@ using System; using System.Collections; -using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Windows.Documents; -using Artemis.Core.Extensions; -using Artemis.Core.Models.Profile.Conditions; -using Artemis.Core.Plugins.DataModelExpansions; -using Artemis.Core.Plugins.DataModelExpansions.Attributes; -using Artemis.UI.Shared.Exceptions; +using Artemis.Core; +using Artemis.Core.DataModelExpansions; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; using Humanizer; using Stylet; -namespace Artemis.UI.Shared.DataModelVisualization.Shared +namespace Artemis.UI.Shared { public abstract class DataModelVisualizationViewModel : PropertyChangedBase { diff --git a/src/Artemis.UI.Shared/Utilities/SizeObserver.cs b/src/Artemis.UI.Shared/DependencyProperties/SizeObserver.cs similarity index 94% rename from src/Artemis.UI.Shared/Utilities/SizeObserver.cs rename to src/Artemis.UI.Shared/DependencyProperties/SizeObserver.cs index 7f099c9bf..8fefcccf4 100644 --- a/src/Artemis.UI.Shared/Utilities/SizeObserver.cs +++ b/src/Artemis.UI.Shared/DependencyProperties/SizeObserver.cs @@ -1,7 +1,10 @@ using System.Windows; -namespace Artemis.UI.Shared.Utilities +namespace Artemis.UI.Shared { + /// + /// Provides a dependency property that can observe the size of an element and apply it to bindings + /// public static class SizeObserver { public static readonly DependencyProperty ObserveProperty = DependencyProperty.RegisterAttached( diff --git a/src/Artemis.UI.Shared/Events/ProfileEventArgs.cs b/src/Artemis.UI.Shared/Events/ProfileEventArgs.cs index c686259b5..3de18067b 100644 --- a/src/Artemis.UI.Shared/Events/ProfileEventArgs.cs +++ b/src/Artemis.UI.Shared/Events/ProfileEventArgs.cs @@ -1,7 +1,7 @@ using System; -using Artemis.Core.Models.Profile; +using Artemis.Core; -namespace Artemis.UI.Shared.Events +namespace Artemis.UI.Shared { public class ProfileEventArgs : EventArgs { diff --git a/src/Artemis.UI.Shared/Events/RenderProfileElementEventArgs.cs b/src/Artemis.UI.Shared/Events/RenderProfileElementEventArgs.cs index e6b027987..7459ed7de 100644 --- a/src/Artemis.UI.Shared/Events/RenderProfileElementEventArgs.cs +++ b/src/Artemis.UI.Shared/Events/RenderProfileElementEventArgs.cs @@ -1,7 +1,7 @@ using System; -using Artemis.Core.Models.Profile; +using Artemis.Core; -namespace Artemis.UI.Shared.Events +namespace Artemis.UI.Shared { public class RenderProfileElementEventArgs : EventArgs { diff --git a/src/Artemis.UI.Shared/Exceptions/ArtemisUIException.cs b/src/Artemis.UI.Shared/Exceptions/ArtemisUIException.cs index 76b7ec01a..0be95e948 100644 --- a/src/Artemis.UI.Shared/Exceptions/ArtemisUIException.cs +++ b/src/Artemis.UI.Shared/Exceptions/ArtemisUIException.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.UI.Shared.Exceptions +namespace Artemis.UI.Shared { public class ArtemisSharedUIException : Exception { diff --git a/src/Artemis.UI.Shared/Ninject/Factories/IVMFactory.cs b/src/Artemis.UI.Shared/Ninject/Factories/IVMFactory.cs deleted file mode 100644 index b04a72929..000000000 --- a/src/Artemis.UI.Shared/Ninject/Factories/IVMFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Artemis.Core.Models.Profile.Colors; -using Artemis.UI.Shared.Screens.GradientEditor; - -namespace Artemis.UI.Shared.Ninject.Factories -{ - public interface IVmFactory - { - } - - public interface IGradientEditorVmFactory : IVmFactory - { - GradientEditorViewModel Create(ColorGradient colorGradient); - } -} \ No newline at end of file diff --git a/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs b/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs index 6688d869c..15949fe33 100644 --- a/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs +++ b/src/Artemis.UI.Shared/Ninject/SharedUIModule.cs @@ -1,30 +1,22 @@ using System; -using Artemis.UI.Shared.Ninject.Factories; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using MaterialDesignThemes.Wpf; using Ninject.Extensions.Conventions; using Ninject.Modules; namespace Artemis.UI.Shared.Ninject { - // ReSharper disable once InconsistentNaming + /// + /// The main of the Artemis Shared UI toolkit that binds all services + /// public class SharedUIModule : NinjectModule { + /// public override void Load() { if (Kernel == null) throw new ArgumentNullException("Kernel shouldn't be null here."); - // Bind UI factories - Kernel.Bind(x => - { - x.FromAssemblyContaining() - .IncludingNonPublicTypes() - .SelectAllInterfaces() - .InheritedFrom() - .BindToFactory(); - }); - // Bind all shared UI services as singletons Kernel.Bind(x => { diff --git a/src/Artemis.UI.Shared/Properties/Annotations.cs b/src/Artemis.UI.Shared/Properties/Annotations.cs index 0081834f4..d2899bae9 100644 --- a/src/Artemis.UI.Shared/Properties/Annotations.cs +++ b/src/Artemis.UI.Shared/Properties/Annotations.cs @@ -32,7 +32,7 @@ using System; // ReSharper disable MemberCanBeProtected.Global // ReSharper disable InconsistentNaming -namespace Artemis.UI.Shared.Annotations +namespace Artemis.UI.Shared.Properties { /// /// Indicates that the value of the marked element could be null sometimes, diff --git a/src/Artemis.UI.Shared/PropertyInput/PropertyInputRegistration.cs b/src/Artemis.UI.Shared/PropertyInput/PropertyInputRegistration.cs index 2b2786d8c..0c1a1e601 100644 --- a/src/Artemis.UI.Shared/PropertyInput/PropertyInputRegistration.cs +++ b/src/Artemis.UI.Shared/PropertyInput/PropertyInputRegistration.cs @@ -1,9 +1,8 @@ using System; using Artemis.Core; -using Artemis.Core.Plugins; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; -namespace Artemis.UI.Shared.PropertyInput +namespace Artemis.UI.Shared { public class PropertyInputRegistration { diff --git a/src/Artemis.UI.Shared/PropertyInput/PropertyInputViewModel.cs b/src/Artemis.UI.Shared/PropertyInput/PropertyInputViewModel.cs index b2f59f322..9d99b7515 100644 --- a/src/Artemis.UI.Shared/PropertyInput/PropertyInputViewModel.cs +++ b/src/Artemis.UI.Shared/PropertyInput/PropertyInputViewModel.cs @@ -1,9 +1,9 @@ using System; -using Artemis.Core.Models.Profile.LayerProperties; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.Core; +using Artemis.UI.Shared.Services; using Stylet; -namespace Artemis.UI.Shared.PropertyInput +namespace Artemis.UI.Shared { public abstract class PropertyInputViewModel : PropertyInputViewModel { @@ -127,7 +127,7 @@ namespace Artemis.UI.Shared.PropertyInput } /// - /// For internal use only, implement instead. + /// For internal use only, implement instead. /// public abstract class PropertyInputViewModel : ValidatingModelBase, IDisposable { @@ -140,7 +140,7 @@ namespace Artemis.UI.Shared.PropertyInput } /// - /// Prevents this type being implemented directly, implement instead. + /// Prevents this type being implemented directly, implement instead. /// // ReSharper disable once UnusedMember.Global internal abstract object InternalGuard { get; } diff --git a/src/Artemis.UI.Shared/Resources/ArtemisShared.xaml b/src/Artemis.UI.Shared/Resources/ArtemisShared.xaml index 127856489..7629bfd44 100644 --- a/src/Artemis.UI.Shared/Resources/ArtemisShared.xaml +++ b/src/Artemis.UI.Shared/Resources/ArtemisShared.xaml @@ -1,6 +1,5 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> diff --git a/src/Artemis.UI.Shared/Screens/Dialogs/ConfirmDialogView.xaml b/src/Artemis.UI.Shared/Screens/Dialogs/ConfirmDialogView.xaml index fcaeacc6f..be6887eff 100644 --- a/src/Artemis.UI.Shared/Screens/Dialogs/ConfirmDialogView.xaml +++ b/src/Artemis.UI.Shared/Screens/Dialogs/ConfirmDialogView.xaml @@ -1,10 +1,10 @@ - + Text="Stack trace" + TextWrapping="Wrap" + FontWeight="Bold" + MaxWidth="1000" /> + FontFamily="pack://application:,,,/Resources/Fonts/#Roboto Mono" + FontSize="10pt" + IsReadOnly="True" + Document="{Binding Document}" + HorizontalScrollBarVisibility="Auto" + VerticalScrollBarVisibility="Auto" + Margin="0 10 10 0" + MaxHeight="500" + Padding="10" /> diff --git a/src/Artemis.UI.Shared/Screens/Exceptions/ExceptionViewModel.cs b/src/Artemis.UI.Shared/Screens/Exceptions/ExceptionViewModel.cs index 1d070337d..91de685e3 100644 --- a/src/Artemis.UI.Shared/Screens/Exceptions/ExceptionViewModel.cs +++ b/src/Artemis.UI.Shared/Screens/Exceptions/ExceptionViewModel.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -using Artemis.UI.Shared.Services.Dialog; using ICSharpCode.AvalonEdit.Document; using Stylet; namespace Artemis.UI.Shared.Screens.Exceptions { - public class ExceptionViewModel : Screen + internal class ExceptionViewModel : Screen { private List _exceptions; @@ -32,7 +31,7 @@ namespace Artemis.UI.Shared.Screens.Exceptions } } - public class DialogException + internal class DialogException { public DialogException(Exception exception) { diff --git a/src/Artemis.UI.Shared/Screens/GradientEditor/ColorStopView.xaml b/src/Artemis.UI.Shared/Screens/GradientEditor/ColorStopView.xaml index 4b5241b3c..af5fdcf45 100644 --- a/src/Artemis.UI.Shared/Screens/GradientEditor/ColorStopView.xaml +++ b/src/Artemis.UI.Shared/Screens/GradientEditor/ColorStopView.xaml @@ -1,13 +1,12 @@ - @@ -16,7 +15,7 @@ - + + - + diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyGroupViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyGroupViewModel.cs index 3cde9cd48..ea05a499d 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyGroupViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyGroupViewModel.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Linq; using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs index 6f5c25c7b..53c0a6c5a 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelinePropertyViewModel.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using Artemis.UI.Screens.ProfileEditor.LayerProperties.Abstract; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline @@ -30,7 +30,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline { var keyframes = LayerPropertyViewModel.LayerProperty.Keyframes.ToList(); var toRemove = TimelineKeyframeViewModels.Where(t => !keyframes.Contains(t.BaseLayerPropertyKeyframe)).ToList(); - foreach (var timelineKeyframeViewModel in toRemove) + foreach (var timelineKeyframeViewModel in toRemove) timelineKeyframeViewModel.Dispose(); TimelineKeyframeViewModels.RemoveRange(toRemove); @@ -57,7 +57,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline private void DisposeKeyframeViewModels() { - foreach (var timelineKeyframeViewModel in TimelineKeyframeViewModels) + foreach (var timelineKeyframeViewModel in TimelineKeyframeViewModels) timelineKeyframeViewModel.Dispose(); TimelineKeyframeViewModels.Clear(); } diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentView.xaml index f8d1d8922..3b7338326 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentView.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline" xmlns:s="https://github.com/canton7/Stylet" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:utilities="clr-namespace:Artemis.UI.Utilities" @@ -17,11 +16,11 @@ - - + IsChecked="{Binding Data.RepeatSegment, Source={StaticResource DataContextProxy}}" + Visibility="{Binding Data.IsMainSegment, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Source={StaticResource DataContextProxy}}" /> + @@ -86,8 +85,8 @@ - - + + @@ -96,7 +95,7 @@ - + diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentViewModel.cs index 36c41ddbd..76a9c0c19 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineSegmentViewModel.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using Artemis.Core.Models.Profile; -using Artemis.UI.Shared.Services.Interfaces; -using Artemis.UI.Shared.Utilities; +using Artemis.Core; +using Artemis.UI.Shared; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline @@ -14,9 +14,9 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline public class TimelineSegmentViewModel : PropertyChangedBase, IDisposable { private bool _draggingSegment; - private bool _showSegmentName; - private bool _showRepeatButton; private bool _showDisableButton; + private bool _showRepeatButton; + private bool _showSegmentName; public TimelineSegmentViewModel(IProfileEditorService profileEditorService, SegmentViewModelType segment) { diff --git a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineView.xaml b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineView.xaml index a5fcb3adb..5935fa23a 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/LayerProperties/Timeline/TimelineView.xaml @@ -49,8 +49,8 @@ X2="{Binding StartSegmentEndPosition}" Y1="0" Y2="{Binding ActualHeight, ElementName=TimelineContainerGrid}" - HorizontalAlignment="Left" - Visibility="{Binding StartSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/> + HorizontalAlignment="Left" + Visibility="{Binding StartSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" /> + Visibility="{Binding EndSegmentEnabled, Converter={x:Static s:BoolToVisibilityConverter.Instance}}" /> - layerPropertyGroups) { LayerPropertiesViewModel = layerPropertiesViewModel; diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml index bb63ce092..afbcfe439 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml @@ -7,8 +7,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor" xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors" - xmlns:profile="clr-namespace:Artemis.Core.Models.Profile;assembly=Artemis.Core" xmlns:dataTemplateSelectors="clr-namespace:Artemis.UI.DataTemplateSelectors" + xmlns:profile="clr-namespace:Artemis.Core;assembly=Artemis.Core" mc:Ignorable="d" behaviors:InputBindingBehavior.PropagateInputBindingsToWindow="True" d:DesignHeight="450" d:DesignWidth="800" @@ -132,7 +132,7 @@ SelectedItem="{Binding SelectedProfile}" ItemTemplateSelector="{dataTemplateSelectors:ComboBoxTemplateSelector SelectedItemTemplate={StaticResource SimpleTemplate}, - DropdownItemsTemplate={StaticResource ExtendedTemplate}}" > + DropdownItemsTemplate={StaticResource ExtendedTemplate}}"> diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs index 27a193b66..52d80ed29 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorViewModel.cs @@ -3,18 +3,15 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows; -using Artemis.Core.Models.Profile; -using Artemis.Core.Plugins.Modules; -using Artemis.Core.Plugins.Settings; +using Artemis.Core; +using Artemis.Core.Modules; using Artemis.Core.Services; -using Artemis.Core.Services.Interfaces; -using Artemis.Core.Services.Storage.Interfaces; using Artemis.UI.Screens.ProfileEditor.Dialogs; using Artemis.UI.Screens.ProfileEditor.DisplayConditions; using Artemis.UI.Screens.ProfileEditor.LayerProperties; using Artemis.UI.Screens.ProfileEditor.ProfileTree; using Artemis.UI.Screens.ProfileEditor.Visualization; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using MaterialDesignThemes.Wpf; using Stylet; @@ -22,21 +19,21 @@ namespace Artemis.UI.Screens.ProfileEditor { public class ProfileEditorViewModel : Conductor.Collection.AllActive { + private readonly IModuleService _moduleService; private readonly IProfileEditorService _profileEditorService; private readonly IProfileService _profileService; private readonly ISettingsService _settingsService; - private readonly IModuleService _moduleService; private readonly ISnackbarMessageQueue _snackbarMessageQueue; - private BindableCollection _profiles; - private PluginSetting _sidePanelsWidth; - private PluginSetting _displayConditionsHeight; private PluginSetting _bottomPanelsHeight; - private PluginSetting _elementPropertiesWidth; - private ProfileViewModel _profileViewModel; - private ProfileTreeViewModel _profileTreeViewModel; - private LayerPropertiesViewModel _layerPropertiesViewModel; + private PluginSetting _displayConditionsHeight; private DisplayConditionsViewModel _displayConditionsViewModel; + private PluginSetting _elementPropertiesWidth; + private LayerPropertiesViewModel _layerPropertiesViewModel; + private BindableCollection _profiles; + private ProfileTreeViewModel _profileTreeViewModel; + private ProfileViewModel _profileViewModel; private ProfileDescriptor _selectedProfile; + private PluginSetting _sidePanelsWidth; public ProfileEditorViewModel(ProfileModule module, ICollection viewModels, diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeView.xaml b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeView.xaml index 2107c3b2f..c4cbdf640 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeView.xaml @@ -6,8 +6,6 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" xmlns:dd="urn:gong-wpf-dragdrop" - xmlns:profileTree="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree" - xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem" xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:profileTree1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree" diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeViewModel.cs index aaaea4220..1593bfecc 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/ProfileTreeViewModel.cs @@ -1,11 +1,11 @@ using System; using System.Linq; using System.Windows; -using Artemis.Core.Models.Profile; +using Artemis.Core; using Artemis.UI.Ninject.Factories; using Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem; -using Artemis.UI.Shared.Events; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared; +using Artemis.UI.Shared.Services; using GongSolutions.Wpf.DragDrop; using Stylet; @@ -15,9 +15,9 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree { private readonly IFolderVmFactory _folderVmFactory; private readonly IProfileEditorService _profileEditorService; + private FolderViewModel _rootFolder; private TreeItemViewModel _selectedTreeItem; private bool _updatingTree; - private FolderViewModel _rootFolder; public ProfileTreeViewModel(IProfileEditorService profileEditorService, IFolderVmFactory folderVmFactory) { @@ -101,6 +101,21 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree RootFolder?.AddLayer(); } + protected override void OnInitialActivate() + { + Subscribe(); + CreateRootFolderViewModel(); + } + + protected override void OnClose() + { + Unsubscribe(); + + RootFolder?.Dispose(); + RootFolder = null; + base.OnClose(); + } + private void CreateRootFolderViewModel() { _updatingTree = true; @@ -152,21 +167,6 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree } } - protected override void OnInitialActivate() - { - Subscribe(); - CreateRootFolderViewModel(); - } - - protected override void OnClose() - { - Unsubscribe(); - - RootFolder?.Dispose(); - RootFolder = null; - base.OnClose(); - } - #region Event handlers private void Subscribe() diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderView.xaml b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderView.xaml index 644d79918..7e10a1d49 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderView.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem" xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderViewModel.cs index 94571d760..16d594f11 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/FolderViewModel.cs @@ -1,24 +1,12 @@ -using Artemis.Core.Models.Profile; -using Artemis.Core.Services.Interfaces; +using Artemis.Core; +using Artemis.Core.Services; using Artemis.UI.Ninject.Factories; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem { public class FolderViewModel : TreeItemViewModel { - protected override void Dispose(bool disposing) - { - if (disposing) - { - foreach (var treeItemViewModel in Children) - treeItemViewModel.Dispose(); - Children.Clear(); - } - - base.Dispose(disposing); - } - // I hate this about DI, oh well public FolderViewModel(ProfileElement folder, IProfileEditorService profileEditorService, @@ -42,5 +30,17 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem } public override bool SupportsChildren => true; + + protected override void Dispose(bool disposing) + { + if (disposing) + { + foreach (var treeItemViewModel in Children) + treeItemViewModel.Dispose(); + Children.Clear(); + } + + base.Dispose(disposing); + } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerView.xaml b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerView.xaml index 397dff827..b8036acc8 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerView.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:treeItem="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem" xmlns:treeItem1="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerViewModel.cs index c2b8e9e6a..c539a5a55 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/LayerViewModel.cs @@ -1,7 +1,7 @@ -using Artemis.Core.Models.Profile; -using Artemis.Core.Services.Interfaces; +using Artemis.Core; +using Artemis.Core.Services; using Artemis.UI.Ninject.Factories; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem { diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/TreeItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/TreeItemViewModel.cs index 0e7f14150..a8d7f006b 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/TreeItemViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileTree/TreeItem/TreeItemViewModel.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Artemis.Core.Models.Profile; -using Artemis.Core.Services.Interfaces; +using Artemis.Core; +using Artemis.Core.Services; using Artemis.UI.Exceptions; using Artemis.UI.Ninject.Factories; using Artemis.UI.Screens.ProfileEditor.Dialogs; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem @@ -191,7 +191,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.TreeItem { // Remove VMs that are no longer a child var toRemove = Children.Where(c => c.ProfileElement.Parent != ProfileElement).ToList(); - foreach (var treeItemViewModel in toRemove) + foreach (var treeItemViewModel in toRemove) Children.Remove(treeItemViewModel); // Order the children diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/CanvasViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/CanvasViewModel.cs index ae843deaf..a5a719060 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/CanvasViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/CanvasViewModel.cs @@ -20,17 +20,17 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization set => SetAndNotify(ref _y, value); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + protected virtual void Dispose(bool disposing) { if (disposing) { } } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceView.xaml index c05915fac..82a471bc7 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceView.xaml @@ -5,8 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" xmlns:converters="clr-namespace:Artemis.UI.Converters" - xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" - xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:visualization1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" mc:Ignorable="d" d:DesignHeight="450" diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceViewModel.cs index 332663a13..828600820 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileDeviceViewModel.cs @@ -2,16 +2,16 @@ using System.Linq; using System.Threading.Tasks; using System.Windows; -using Artemis.Core.Models.Surface; +using Artemis.Core; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.Visualization { public class ProfileDeviceViewModel : CanvasViewModel { - private ObservableCollection _leds; - private ArtemisDevice _device; private bool _addedLeds; + private ArtemisDevice _device; + private ObservableCollection _leds; public ProfileDeviceViewModel(ArtemisDevice device) { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerView.xaml index 37c85752d..9a59226ea 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerView.xaml @@ -3,8 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" - xmlns:s="https://github.com/canton7/Stylet" xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" mc:Ignorable="d" d:DesignHeight="450" @@ -31,26 +29,6 @@ - diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerViewModel.cs index cb8887bed..ebe679a8f 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLayerViewModel.cs @@ -3,12 +3,10 @@ using System.ComponentModel; using System.Linq; using System.Windows; using System.Windows.Media; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Profile.LayerShapes; -using Artemis.Core.Models.Surface; +using Artemis.Core; using Artemis.UI.Extensions; using Artemis.UI.Services.Interfaces; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.Visualization @@ -133,10 +131,10 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization var shapeGeometry = Geometry.Empty; switch (Layer.LayerShape) { - case Ellipse _: + case EllipseShape _: shapeGeometry = new EllipseGeometry(bounds); break; - case Rectangle _: + case RectangleShape _: shapeGeometry = new RectangleGeometry(bounds); break; } diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedView.xaml index 116799494..083bfc23c 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedView.xaml @@ -4,7 +4,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:converters="clr-namespace:Artemis.UI.Converters" - xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" xmlns:visualization1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" mc:Ignorable="d" d:DataContext="{d:DesignInstance {x:Type visualization1:ProfileLedViewModel}}" diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedViewModel.cs index f6e327b16..26abba437 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileLedViewModel.cs @@ -1,7 +1,7 @@ using System; using System.Windows; using System.Windows.Media; -using Artemis.Core.Models.Surface; +using Artemis.Core; using Artemis.UI.Extensions; using RGB.NET.Core; using Stylet; @@ -11,11 +11,11 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization { public class ProfileLedViewModel : PropertyChangedBase { - private bool _isSelected; - private bool _isDimmed; - private Geometry _displayGeometry; - private Geometry _strokeGeometry; private Color _displayColor; + private Geometry _displayGeometry; + private bool _isDimmed; + private bool _isSelected; + private Geometry _strokeGeometry; public ProfileLedViewModel(ArtemisLed led) { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml index d92ada6a2..2db249ab1 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileView.xaml @@ -5,10 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:s="https://github.com/canton7/Stylet" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" - xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" - xmlns:utilities="clr-namespace:Artemis.UI.Shared.Utilities;assembly=Artemis.UI.Shared" - xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" xmlns:visualization="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignHeight="510.9" d:DesignWidth="800" d:DataContext="{d:DesignInstance {x:Type visualization:ProfileViewModel}}"> @@ -77,9 +75,9 @@ MouseDown="{s:Action CanvasMouseDown}" MouseMove="{s:Action CanvasMouseMove}" Cursor="{Binding ActiveToolViewModel.Cursor}" - utilities:SizeObserver.Observe="True" - utilities:SizeObserver.ObservedWidth="{Binding PanZoomViewModel.CanvasWidth, Mode=OneWayToSource}" - utilities:SizeObserver.ObservedHeight="{Binding PanZoomViewModel.CanvasHeight, Mode=OneWayToSource}"> + shared:SizeObserver.Observe="True" + shared:SizeObserver.ObservedWidth="{Binding PanZoomViewModel.CanvasWidth, Mode=OneWayToSource}" + shared:SizeObserver.ObservedHeight="{Binding PanZoomViewModel.CanvasHeight, Mode=OneWayToSource}"> @@ -123,9 +121,9 @@ - + diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileViewModel.cs index cbfb7df58..c64e1ffcc 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/ProfileViewModel.cs @@ -3,18 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Input; -using Artemis.Core.Events; -using Artemis.Core.Models.Profile; -using Artemis.Core.Models.Surface; -using Artemis.Core.Plugins.Settings; +using Artemis.Core; using Artemis.Core.Services; -using Artemis.Core.Services.Storage.Interfaces; using Artemis.UI.Events; using Artemis.UI.Extensions; using Artemis.UI.Ninject.Factories; using Artemis.UI.Screens.ProfileEditor.Visualization.Tools; using Artemis.UI.Screens.Shared; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using Stylet; namespace Artemis.UI.Screens.ProfileEditor.Visualization @@ -211,6 +207,11 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization base.OnClose(); } + protected override void OnActivate() + { + ApplyActiveProfile(); + } + private void OnActiveSurfaceConfigurationSelected(object sender, SurfaceConfigurationEventArgs e) { ApplySurfaceConfiguration(e.Surface); @@ -237,11 +238,6 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization } } - protected override void OnActivate() - { - ApplyActiveProfile(); - } - private void ApplySurfaceConfiguration(ArtemisSurface surface) { Devices.Clear(); diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolView.xaml index 892d021b6..d184d1b06 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolView.xaml @@ -3,8 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.Tools" - xmlns:userControls="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.UserControls" xmlns:s="https://github.com/canton7/Stylet" xmlns:tools="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.Tools" xmlns:userControls1="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.UserControls" @@ -14,17 +12,17 @@ d:DataContext="{d:DesignInstance {x:Type tools:EditToolViewModel}}"> + ShapePath="{Binding ShapePath}" + ShapeAnchor="{Binding ShapeAnchor}" + ShapeGeometry="{Binding ShapeGeometry}" + RotateMouseDown="{s:Action RotateMouseDown}" + RotateMouseUp="{s:Action RotateMouseUp}" + RotateMouseMove="{s:Action RotateMouseMove}" + ResizeMouseDown="{s:Action ResizeMouseDown}" + ResizeMouseUp="{s:Action ResizeMouseUp}" + ResizeMouseMove="{s:Action ResizeMouseMove}" + MoveMouseDown="{s:Action MoveMouseDown}" + MoveMouseUp="{s:Action MoveMouseUp}" + MoveMouseMove="{s:Action MoveMouseMove}" /> \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolViewModel.cs index bcad940ac..1a25f5fba 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/EditToolViewModel.cs @@ -2,10 +2,10 @@ using System.Windows; using System.Windows.Input; using System.Windows.Media; -using Artemis.Core.Models.Profile; +using Artemis.Core; using Artemis.UI.Events; using Artemis.UI.Services.Interfaces; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; using SkiaSharp; using SkiaSharp.Views.WPF; using Stylet; @@ -17,10 +17,10 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools private readonly ILayerEditorService _layerEditorService; private SKPoint _dragOffset; private SKPoint _dragStart; - private SKPoint _topLeft; - private SKPath _shapePath; private SKPoint _shapeAnchor; private RectangleGeometry _shapeGeometry; + private SKPath _shapePath; + private SKPoint _topLeft; public EditToolViewModel(ProfileViewModel profileViewModel, IProfileEditorService profileEditorService, ILayerEditorService layerEditorService) : base(profileViewModel, profileEditorService) diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionRemoveToolViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionRemoveToolViewModel.cs index 6805fbb6d..0cf6eb665 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionRemoveToolViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionRemoveToolViewModel.cs @@ -2,9 +2,9 @@ using System.Linq; using System.Windows; using System.Windows.Input; -using Artemis.Core.Models.Profile; +using Artemis.Core; using Artemis.UI.Properties; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionToolViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionToolViewModel.cs index 6c1476eee..c6e84ce99 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionToolViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/SelectionToolViewModel.cs @@ -2,10 +2,10 @@ using System.Linq; using System.Windows; using System.Windows.Input; -using Artemis.Core.Models.Profile; -using Artemis.Core.Services.Interfaces; +using Artemis.Core; +using Artemis.Core.Services; using Artemis.UI.Properties; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolView.xaml b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolView.xaml index 9815cfb58..0bd1c82e2 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolView.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.Visualization.Tools" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolViewModel.cs index 245451fa6..5a795bbc3 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/ViewpointMoveToolViewModel.cs @@ -1,5 +1,5 @@ using System.Windows.Input; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools { diff --git a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/VisualizationToolViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/VisualizationToolViewModel.cs index ac0b14eaa..ce967b019 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/VisualizationToolViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/Visualization/Tools/VisualizationToolViewModel.cs @@ -1,7 +1,7 @@ using System; using System.Windows; using System.Windows.Input; -using Artemis.UI.Shared.Services.Interfaces; +using Artemis.UI.Shared.Services; namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools { diff --git a/src/Artemis.UI/Screens/RootView.xaml b/src/Artemis.UI/Screens/RootView.xaml index 2d0bb3fcf..c3c016cdd 100644 --- a/src/Artemis.UI/Screens/RootView.xaml +++ b/src/Artemis.UI/Screens/RootView.xaml @@ -72,7 +72,8 @@ - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/RootViewModel.cs b/src/Artemis.UI/Screens/RootViewModel.cs index c6c29a490..448a7d04b 100644 --- a/src/Artemis.UI/Screens/RootViewModel.cs +++ b/src/Artemis.UI/Screens/RootViewModel.cs @@ -5,9 +5,8 @@ using System.Threading.Tasks; using System.Timers; using System.Windows; using System.Windows.Input; -using Artemis.Core.Plugins.Settings; +using Artemis.Core; using Artemis.Core.Services; -using Artemis.Core.Services.Interfaces; using Artemis.UI.Events; using Artemis.UI.Screens.Settings.Tabs.General; using Artemis.UI.Screens.Sidebar; diff --git a/src/Artemis.UI/Screens/Settings/Debug/DeviceDebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/DeviceDebugView.xaml index 92d698b6a..d6cd0a90e 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/DeviceDebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/DeviceDebugView.xaml @@ -7,8 +7,8 @@ xmlns:s="https://github.com/canton7/Stylet" xmlns:mde="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions" xmlns:debug="clr-namespace:Artemis.UI.Screens.Settings.Debug" - xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" - xmlns:surface="clr-namespace:Artemis.Core.Models.Surface;assembly=Artemis.Core" + xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" Title="Artemis device debugger" TitleBarIcon="{StaticResource BowIcon}" @@ -49,7 +49,7 @@ - + @@ -59,7 +59,7 @@ Please note that having this window open can have a performance impact on your system. - + @@ -235,7 +235,7 @@ @@ -54,14 +54,13 @@ - diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs index f30594cd5..a962339f5 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/DataModelDebugViewModel.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; using System.Timers; -using Artemis.Core.Events; -using Artemis.Core.Services.Interfaces; -using Artemis.UI.Shared.DataModelVisualization.Shared; +using Artemis.Core; +using Artemis.Core.Modules; +using Artemis.Core.Services; +using Artemis.UI.Shared; using Artemis.UI.Shared.Services; -using Artemis.UI.Shared.Services.Interfaces; using Stylet; namespace Artemis.UI.Screens.Settings.Debug.Tabs @@ -17,9 +17,9 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs private readonly Timer _updateTimer; private bool _isModuleFilterEnabled; private DataModelPropertiesViewModel _mainDataModel; - private List _modules; + private List _modules; private string _propertySearch; - private Core.Plugins.Modules.Module _selectedModule; + private Module _selectedModule; public DataModelDebugViewModel(IDataModelUIService dataModelUIService, IPluginService pluginService) { @@ -42,13 +42,13 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs set => SetAndNotify(ref _propertySearch, value); } - public List Modules + public List Modules { get => _modules; set => SetAndNotify(ref _modules, value); } - public Core.Plugins.Modules.Module SelectedModule + public Module SelectedModule { get => _selectedModule; set @@ -110,7 +110,7 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs private void PopulateModules() { - Modules = _pluginService.GetPluginsOfType().Where(p => p.Enabled).ToList(); + Modules = _pluginService.GetPluginsOfType().Where(p => p.Enabled).ToList(); } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml index 062a40ee8..9982531f3 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml @@ -1,12 +1,10 @@  - - - - + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml.cs index 1ff5fe777..b78bb180b 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugView.xaml.cs @@ -1,20 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows.Controls; namespace Artemis.UI.Screens.Settings.Debug.Tabs { /// - /// Interaction logic for LogsDebugView.xaml + /// Interaction logic for LogsDebugView.xaml /// public partial class LogsDebugView : UserControl { @@ -23,4 +12,4 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs InitializeComponent(); } } -} +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs index 20aa75b24..5605473be 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/LogsDebugViewModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Stylet; +using Stylet; namespace Artemis.UI.Screens.Settings.Debug.Tabs { @@ -12,4 +9,4 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs DisplayName = "Logs"; } } -} +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml index d79240e2c..45b829da1 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugView.xaml @@ -1,11 +1,11 @@  @@ -32,4 +32,4 @@ - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs index b35d07865..215b4eae9 100644 --- a/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Debug/Tabs/RenderDebugViewModel.cs @@ -2,8 +2,8 @@ using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; -using Artemis.Core.Events; -using Artemis.Core.Services.Interfaces; +using Artemis.Core; +using Artemis.Core.Services; using SkiaSharp; using SkiaSharp.Views.WPF; using Stylet; diff --git a/src/Artemis.UI/Screens/Settings/SettingsView.xaml b/src/Artemis.UI/Screens/Settings/SettingsView.xaml index 00f66503b..3042626be 100644 --- a/src/Artemis.UI/Screens/Settings/SettingsView.xaml +++ b/src/Artemis.UI/Screens/Settings/SettingsView.xaml @@ -16,17 +16,17 @@ - - - + + diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabView.xaml b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabView.xaml index ab9cfe1bb..a1a7bb425 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabView.xaml +++ b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabView.xaml @@ -1,11 +1,11 @@  @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs index 3003eff54..aa1d88c12 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs +++ b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsTabViewModel.cs @@ -1,6 +1,6 @@ using System.Linq; using System.Threading.Tasks; -using Artemis.Core.Services.Storage.Interfaces; +using Artemis.Core.Services; using Artemis.UI.Ninject.Factories; using Stylet; diff --git a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsView.xaml b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsView.xaml index dca39d554..46c27a1e5 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsView.xaml +++ b/src/Artemis.UI/Screens/Settings/Tabs/Devices/DeviceSettingsView.xaml @@ -6,7 +6,7 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" xmlns:devices="clr-namespace:Artemis.UI.Screens.Settings.Tabs.Devices" - xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" d:DataContext="{d:DesignInstance devices:DeviceSettingsViewModel}" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -30,7 +30,7 @@ - +