Core - Added stores for the different register-able types

Profiles - Refactored large parts of the profile structure to use these stores
This commit is contained in:
Robert authored and SpoinkyNL committed 2020-09-09 19:56:06 +02:00
1 parent 4cfe71796c
commit 11de30318e
75 files changed
+1526 -934

No files matched your search

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Properties;
namespace Artemis.Core.Services
{
/// <summary>
/// A service that allows you to register and retrieve conditions operators used by display conditions
/// </summary>
public interface IConditionOperatorService : IArtemisService
{
/// <summary>
/// Registers a new condition operator for use in layer conditions
/// </summary>
/// <param name="pluginInfo">The PluginInfo of the plugin this condition operator belongs to</param>
/// <param name="conditionOperator">The condition operator to register</param>
ConditionOperatorRegistration RegisterConditionOperator([NotNull] PluginInfo pluginInfo, [NotNull] ConditionOperator conditionOperator);
/// <summary>
/// Removes a condition operator so it is no longer available for use in layer conditions
/// </summary>
/// <param name="registration">The registration of the condition operator to remove</param>
void RemoveConditionOperator([NotNull] ConditionOperatorRegistration registration);
/// <summary>
/// Returns all the condition operators compatible with the provided type
/// </summary>
List<ConditionOperator> GetConditionOperatorsForType(Type type);
/// <summary>
/// Gets a condition operator by its plugin GUID and type name
/// </summary>
/// <param name="operatorPluginGuid">The operator's plugin GUID</param>
/// <param name="operatorType">The type name of the operator</param>
ConditionOperator GetConditionOperator(Guid operatorPluginGuid, string operatorType);
}
}
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Properties;
namespace Artemis.Core.Services
{
/// <summary>
/// A service that allows you to register and retrieve data binding modifiers used by the data bindings system
/// </summary>
public interface IDataBindingService : IArtemisService
{
/// <summary>
/// Registers a new modifier type for use in data bindings
/// </summary>
/// <param name="pluginInfo">The PluginInfo of the plugin this modifier type belongs to</param>
/// <param name="dataBindingModifierType">The modifier type to register</param>
DataBindingModifierTypeRegistration RegisterModifierType([NotNull] PluginInfo pluginInfo, [NotNull] DataBindingModifierType dataBindingModifierType);
/// <summary>
/// Removes a modifier type so it is no longer available for use in data bindings
/// </summary>
/// <param name="dataBindingModifierType">The registration of the modifier type to remove</param>
void RemoveModifierType([NotNull] DataBindingModifierTypeRegistration dataBindingModifierType);
/// <summary>
/// Returns all the data binding modifier types compatible with the provided type
/// </summary>
List<DataBindingModifierType> GetCompatibleModifierTypes(Type type);
/// <summary>
/// Gets a modifier type by its plugin GUID and type name
/// </summary>
/// <param name="modifierTypePluginGuid">The modifier type's plugin GUID</param>
/// <param name="modifierType">The type name of the modifier type</param>
/// <returns></returns>
DataBindingModifierType GetModifierType(Guid modifierTypePluginGuid, string modifierType);
}
}
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using Artemis.Core.DataModelExpansions;
namespace Artemis.Core.Services
{
/// <summary>
/// A service that allows you to register and retrieve data models
/// </summary>
public interface IDataModelService : IArtemisService
{
/// <summary>
/// Add a data model to so that it is available to conditions and data bindings
/// </summary>
/// <param name="dataModel"></param>
DataModelRegistration RegisterDataModel(DataModel dataModel);
/// <summary>
/// Remove a previously added data model so that it is no longer available
/// </summary>
void RemoveDataModel(DataModelRegistration registration);
/// <summary>
/// Returns a list of all registered data models
/// </summary>
List<DataModel> GetDataModels();
/// <summary>
/// If found, returns the registered data model of type <typeparamref name="T" />
/// </summary>
/// <typeparam name="T">The type of the data model to find</typeparam>
T GetDataModel<T>() where T : DataModel;
/// <summary>
/// If found, returns the data model of the provided plugin
/// </summary>
/// <param name="plugin">The plugin to find the data model of</param>
DataModel GetPluginDataModel(Plugin plugin);
/// <summary>
/// If found, returns the data model of the provided plugin GUID
/// </summary>
/// <param name="pluginGuid">The GUID of the plugin to find the data model of</param>
DataModel GetPluginDataModel(Guid pluginGuid);
}
}
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Artemis.Core.LayerBrushes;
namespace Artemis.Core.Services
{
/// <summary>
/// A service that allows you to register and retrieve layer brushes
/// </summary>
public interface ILayerBrushService : IArtemisService
{
/// <summary>
/// Add a layer brush descriptor so that it is available to layers
/// </summary>
LayerBrushRegistration RegisterLayerBrush(LayerBrushDescriptor descriptor);
/// <summary>
/// Remove a previously added layer brush descriptor so that it is no longer available
/// </summary>
void RemoveLayerBrush(LayerBrushRegistration registration);
/// <summary>
/// Returns a list of all registered layer brush descriptors
/// </summary>
List<LayerBrushDescriptor> GetLayerBrushes();
}
}
@@ -0,0 +1,27 @@
using System.Collections.Generic;
using Artemis.Core.LayerBrushes;
using Artemis.Core.LayerEffects;
namespace Artemis.Core.Services
{
/// <summary>
/// A service that allows you to register and retrieve layer brushes
/// </summary>
public interface ILayerEffectService : IArtemisService
{
/// <summary>
/// Add an effect descriptor so that it is available to profile elements
/// </summary>
LayerEffectRegistration RegisterLayerEffect(LayerEffectDescriptor descriptor);
/// <summary>
/// Remove a previously added layer effect descriptor so that it is no longer available
/// </summary>
void RemoveLayerEffect(LayerEffectRegistration registration);
/// <summary>
/// Returns a list of all registered layer effect descriptors
/// </summary>
List<LayerEffectDescriptor> GetLayerEffects();
}
}