mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Centralized default editors registration into a service
Display conditions - Added more test operators Display conditions - Implemented operator selection Display conditions - Implemented property selection and rules
This commit is contained in:
1 parent
71f6706eec
commit
f944a675f1
26 files changed
+470
-179
No files matched your search
@@ -40,7 +40,18 @@ namespace Artemis.Core.Services
|
||||
AddDataModelExpansionDataModel(dataModelExpansion);
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<DataModel> DataModelExpansions
|
||||
public IReadOnlyCollection<DisplayConditionOperator> RegisteredConditionOperators
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (_registeredConditionOperators)
|
||||
{
|
||||
return _registeredConditionOperators.AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<DataModel> DataModelExpansions
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -128,13 +139,20 @@ namespace Artemis.Core.Services
|
||||
{
|
||||
lock (_registeredConditionOperators)
|
||||
{
|
||||
return _registeredConditionOperators.Where(c => c.CompatibleTypes.Contains(type)).ToList();
|
||||
if (type == null)
|
||||
return new List<DisplayConditionOperator>(_registeredConditionOperators);
|
||||
return _registeredConditionOperators.Where(c => c.CompatibleTypes.Any(t => t.IsAssignableFrom(type))).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterBuiltInConditionOperators()
|
||||
{
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new EqualsConditionOperator());
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new NotEqualConditionOperator());
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new LessThanConditionOperator());
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new GreaterThanConditionOperator());
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new LessThanOrEqualConditionOperator());
|
||||
RegisterConditionOperator(Constants.CorePluginInfo, new GreaterThanOrEqualConditionOperator());
|
||||
}
|
||||
|
||||
private void PluginServiceOnPluginEnabled(object sender, PluginEventArgs e)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Core.Annotations;
|
||||
using Artemis.Core.Models.Profile.Conditions;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
@@ -9,7 +10,8 @@ namespace Artemis.Core.Services.Interfaces
|
||||
{
|
||||
public interface IDataModelService : IArtemisService
|
||||
{
|
||||
ReadOnlyCollection<DataModel> DataModelExpansions { get; }
|
||||
IReadOnlyCollection<DisplayConditionOperator> RegisteredConditionOperators { get; }
|
||||
IReadOnlyCollection<DataModel> DataModelExpansions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Add an expansion to the datamodel to be available for use after the next update
|
||||
@@ -48,5 +50,7 @@ namespace Artemis.Core.Services.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="displayConditionOperator">The layer condition operator to remove</param>
|
||||
void RemoveConditionOperator([NotNull] DisplayConditionOperator displayConditionOperator);
|
||||
|
||||
List<DisplayConditionOperator> GetCompatibleConditionOperators(Type type);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user