Core - Flattened namespaces

Shared UI - Flattened namespaces
Shared UI - General housekeeping
Project - Code cleanup
This commit is contained in:
SpoinkyNL committed 2020-09-01 00:14:08 +02:00
1 parent aa06d8c43e
commit 29d4db55db
454 files changed
+1678 -1938

No files matched your search

@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.DataModelExpansions.Attributes
namespace Artemis.Core.DataModelExpansions
{
public class DataModelIgnoreAttribute : Attribute
{
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.DataModelExpansions.Attributes
namespace Artemis.Core.DataModelExpansions
{
[AttributeUsage(AttributeTargets.Property)]
public class DataModelPropertyAttribute : Attribute
@@ -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
{
@@ -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
{
/// <summary>
/// Allows you to expand the application-wide datamodel
@@ -32,7 +30,8 @@ namespace Artemis.Core.Plugins.DataModelExpansions
}
/// <summary>
/// Stop hiding the provided property using a lambda expression, e.g. ShowProperty(dm => dm.TimeDataModel.CurrentTimeUTC)
/// Stop hiding the provided property using a lambda expression, e.g. ShowProperty(dm =>
/// dm.TimeDataModel.CurrentTimeUTC)
/// </summary>
/// <param name="propertyLambda">A lambda expression pointing to the property to stop ignoring</param>
public void ShowProperty<TProperty>(Expression<Func<T, TProperty>> propertyLambda)
@@ -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
{
/// <summary>
/// For internal use only, to implement your own layer property type, extend <see cref="DataModelExpansion{T}" />
@@ -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
{
/// <inheritdoc />
/// <summary>
@@ -1,32 +0,0 @@
using System;
namespace Artemis.Core.Plugins.Exceptions
{
public class ArtemisPluginException : Exception
{
public ArtemisPluginException(PluginInfo pluginInfo)
{
PluginInfo = pluginInfo;
}
public ArtemisPluginException(PluginInfo pluginInfo, string message) : base(message)
{
PluginInfo = pluginInfo;
}
public ArtemisPluginException(PluginInfo pluginInfo, string message, Exception inner) : base(message, inner)
{
PluginInfo = pluginInfo;
}
public ArtemisPluginException(string message) : base(message)
{
}
public ArtemisPluginException(string message, Exception inner) : base(message, inner)
{
}
public PluginInfo PluginInfo { get; }
}
}
@@ -1,18 +0,0 @@
using System;
namespace Artemis.Core.Plugins.Exceptions
{
public class ArtemisPluginLockException : Exception
{
public ArtemisPluginLockException(Exception innerException) : base(CreateExceptionMessage(innerException), innerException)
{
}
private static string CreateExceptionMessage(Exception innerException)
{
return innerException != null
? "Found a lock file, skipping load, see inner exception for last known exception."
: "Found a lock file, skipping load.";
}
}
}
@@ -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
{
@@ -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
{
/// <summary>
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
@@ -127,7 +125,7 @@ namespace Artemis.Core.Plugins.LayerBrushes.Internal
Regular,
/// <summary>
/// An RGB.NET brush that uses RGB.NET's per-LED rendering engine.
/// An RGB.NET brush that uses RGB.NET's per-LED rendering engine.
/// </summary>
RgbNet
}
@@ -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
{
/// <summary>
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="RgbNetLayerBrush{T}" /> or instead
@@ -1,9 +1,7 @@
using Artemis.Core.Models.Profile;
using Artemis.Core.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<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
{
@@ -1,7 +1,6 @@
using System;
using Artemis.Core.Plugins.LayerBrushes.Internal;
namespace Artemis.Core.Plugins.LayerBrushes
namespace Artemis.Core.LayerBrushes
{
/// <inheritdoc />
public class LayerBrushConfigurationDialog<T> : LayerBrushConfigurationDialog where T : BrushConfigurationViewModel
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.LayerBrushes
namespace Artemis.Core.LayerBrushes
{
/// <summary>
/// A class that describes a layer brush
@@ -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
{
/// <summary>
/// Allows you to create one or more <see cref="LayerBrush{T}" />s usable by profile layers.
@@ -1,10 +1,7 @@
using Artemis.Core.Models.Profile;
using Artemis.Core.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<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
{
@@ -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
{
/// <summary>
/// An RGB.NET brush that uses RGB.NET's per-LED rendering engine.
@@ -1,6 +1,6 @@
using Stylet;
namespace Artemis.Core.Plugins.LayerEffects
namespace Artemis.Core.LayerEffects
{
public abstract class EffectConfigurationViewModel : Screen
{
@@ -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
{
/// <summary>
/// For internal use only, please use <see cref="LayerEffect{T}" /> instead
/// </summary>
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;
/// <summary>
/// Gets the unique ID of this effect
@@ -76,7 +75,7 @@ namespace Artemis.Core.Plugins.LayerEffects
}
/// <summary>
/// Gets the <see cref="LayerEffectDescriptor"/> that registered this effect
/// Gets the <see cref="LayerEffectDescriptor" /> that registered this effect
/// </summary>
public LayerEffectDescriptor Descriptor
{
@@ -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<T> : BaseLayerEffect where T : LayerPropertyGroup
{
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.LayerEffects
namespace Artemis.Core.LayerEffects
{
/// <inheritdoc />
public class LayerEffectConfigurationDialog<T> : LayerEffectConfigurationDialog where T : EffectConfigurationViewModel
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.LayerEffects
namespace Artemis.Core.LayerEffects
{
/// <summary>
/// A class that describes a layer effect
@@ -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
{
/// <summary>
/// Allows you to register one or more <see cref="LayerEffect{T}" />s usable by profile layers.
@@ -13,7 +12,7 @@ namespace Artemis.Core.Plugins.LayerEffects
private readonly List<LayerEffectDescriptor> _layerEffectDescriptors;
/// <summary>
/// Allows you to register one or more <see cref="LayerEffect{T}" />s usable by profile layers.
/// Allows you to register one or more <see cref="LayerEffect{T}" />s usable by profile layers.
/// </summary>
protected LayerEffectProvider()
{
@@ -1,4 +1,4 @@
namespace Artemis.Core.Plugins.Modules.ActivationRequirements
namespace Artemis.Core.Modules
{
/// <summary>
/// Evaluates to true or false by returning the value of ActivationMet
@@ -1,4 +1,4 @@
namespace Artemis.Core.Plugins.Modules.ActivationRequirements
namespace Artemis.Core.Modules
{
/// <summary>
/// Evaluates to true or false by checking requirements specific to the implementation
@@ -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
{
/// <summary>
/// Evaluates to true or false by checking if the specified process is running
+2 -5
View File
@@ -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
{
/// <summary>
/// Allows you to add support for new games/applications while utilizing your own data model
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins.Modules
namespace Artemis.Core.Modules
{
/// <inheritdoc />
public class ModuleTab<T> : ModuleTab where T : ModuleViewModel
@@ -1,14 +1,14 @@
using Stylet;
namespace Artemis.Core.Plugins.Modules
namespace Artemis.Core.Modules
{
/// <summary>
/// The base class for any view model that belongs to a module
/// The base class for any view model that belongs to a module
/// </summary>
public abstract class ModuleViewModel : Screen
{
/// <summary>
/// The base class for any view model that belongs to a module
/// The base class for any view model that belongs to a module
/// </summary>
/// <param name="module">The module this view model belongs to</param>
/// <param name="displayName">The name of the tab that's shown on the modules UI page</param>
@@ -19,7 +19,7 @@ namespace Artemis.Core.Plugins.Modules
}
/// <summary>
/// Gets the module this view model belongs to
/// Gets the module this view model belongs to
/// </summary>
public Module Module { get; }
}
@@ -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
{
/// <summary>
/// Allows you to add support for new games/applications while utilizing Artemis' profile engine and your own data
+2 -3
View File
@@ -1,8 +1,7 @@
using System;
using System.Threading.Tasks;
using Artemis.Core.Plugins.Exceptions;
namespace Artemis.Core.Plugins
namespace Artemis.Core
{
/// <summary>
/// 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
/// </summary>
public bool Enabled { get; private set; }
/// <summary>
/// Gets or sets a configuration dialog for this plugin that is accessible in the UI under Settings > Plugins
/// </summary>
@@ -1,6 +1,6 @@
using System;
namespace Artemis.Core.Plugins
namespace Artemis.Core
{
/// <inheritdoc />
public class PluginConfigurationDialog<T> : PluginConfigurationDialog where T : PluginConfigurationViewModel
@@ -1,6 +1,6 @@
using Stylet;
namespace Artemis.Core.Plugins
namespace Artemis.Core
{
public abstract class PluginConfigurationViewModel : Screen
{
+1 -1
View File
@@ -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
@@ -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<T> : PropertyChangedBase
{
@@ -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
{
/// <summary>
/// <para>This contains all the settings for your plugin. To access a setting use <see cref="GetSetting{T}" />.</para>
@@ -46,7 +46,7 @@ namespace Artemis.Core.Plugins.Settings
}
var pluginSetting = new PluginSetting<T>(_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)