mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Display conditions - Some work on inputs supporting multiple types
This commit is contained in:
1 parent
3639185171
commit
92dfbb354a
16 files changed
+112
-49
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
|
||||
@@ -6,9 +7,42 @@ namespace Artemis.Core
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// The full path to the Artemis application folder
|
||||
/// </summary>
|
||||
public static readonly string ApplicationFolder = Path.GetDirectoryName(typeof(Constants).Assembly.Location);
|
||||
|
||||
/// <summary>
|
||||
/// The full path to the Artemis data folder
|
||||
/// </summary>
|
||||
public static readonly string DataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Artemis\\";
|
||||
|
||||
/// <summary>
|
||||
/// The connection string used to connect to the database
|
||||
/// </summary>
|
||||
public static readonly string ConnectionString = $"FileName={DataFolder}\\database.db";
|
||||
|
||||
/// <summary>
|
||||
/// The plugin info used by core components of Artemis
|
||||
/// </summary>
|
||||
public static readonly PluginInfo CorePluginInfo = new PluginInfo {Guid = Guid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff"), Name = "Artemis Core"};
|
||||
|
||||
/// <summary>
|
||||
/// A read-only collection containing all primitive number types
|
||||
/// </summary>
|
||||
public static IReadOnlyCollection<Type> NumberTypes = new List<Type>
|
||||
{
|
||||
typeof(sbyte),
|
||||
typeof(byte),
|
||||
typeof(short),
|
||||
typeof(ushort),
|
||||
typeof(int),
|
||||
typeof(uint),
|
||||
typeof(long),
|
||||
typeof(ulong),
|
||||
typeof(float),
|
||||
typeof(double),
|
||||
typeof(decimal)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -10,24 +10,6 @@ namespace Artemis.Core.Models.Profile.Conditions
|
||||
{
|
||||
public abstract class DisplayConditionOperator
|
||||
{
|
||||
/// <summary>
|
||||
/// A read-only collection containing all primitive number types
|
||||
/// </summary>
|
||||
protected static IReadOnlyCollection<Type> NumberTypes = new List<Type>
|
||||
{
|
||||
typeof(sbyte),
|
||||
typeof(byte),
|
||||
typeof(short),
|
||||
typeof(ushort),
|
||||
typeof(int),
|
||||
typeof(uint),
|
||||
typeof(long),
|
||||
typeof(ulong),
|
||||
typeof(float),
|
||||
typeof(double),
|
||||
typeof(decimal)
|
||||
};
|
||||
|
||||
private IDataModelService _dataModelService;
|
||||
private bool _registered;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Artemis.Core.Models.Profile.Conditions.Operators
|
||||
{
|
||||
public class GreaterThanConditionOperator : DisplayConditionOperator
|
||||
{
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => NumberTypes;
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => Constants.NumberTypes;
|
||||
|
||||
public override string Description => "Is greater than";
|
||||
public override string Icon => "GreaterThan";
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Artemis.Core.Models.Profile.Conditions.Operators
|
||||
{
|
||||
public class GreaterThanOrEqualConditionOperator : DisplayConditionOperator
|
||||
{
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => NumberTypes;
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => Constants.NumberTypes;
|
||||
|
||||
public override string Description => "Is greater than or equal to";
|
||||
public override string Icon => "GreaterThanOrEqual";
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Artemis.Core.Models.Profile.Conditions.Operators
|
||||
{
|
||||
public class LessThanConditionOperator : DisplayConditionOperator
|
||||
{
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => NumberTypes;
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => Constants.NumberTypes;
|
||||
|
||||
public override string Description => "Is less than";
|
||||
public override string Icon => "LessThan";
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ namespace Artemis.Core.Models.Profile.Conditions.Operators
|
||||
{
|
||||
public class LessThanOrEqualConditionOperator : DisplayConditionOperator
|
||||
{
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => NumberTypes;
|
||||
public override IReadOnlyCollection<Type> CompatibleTypes => Constants.NumberTypes;
|
||||
|
||||
public override string Description => "Is less than or equal to";
|
||||
public override string Icon => "LessThanOrEqual";
|
||||
|
||||
Reference in new issue
Block a user