Display conditions - Loosened up type rules for dynamic comparisons

Display conditions - Improved static value input and added support for int and double
This commit is contained in:
Robert committed 2020-07-07 17:29:20 +02:00
1 parent 68b9a4b933
commit f617a6461a
21 files changed
+197 -172

No files matched your search

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
using Artemis.Core.Plugins.Exceptions;
@@ -150,9 +151,13 @@ namespace Artemis.UI.Shared.Services
{
lock (_registeredDataModelEditors)
{
var match = _registeredDataModelEditors.FirstOrDefault(d => d.SupportedType.IsAssignableFrom(propertyType));
var match = _registeredDataModelEditors.FirstOrDefault(d => d.SupportedType == propertyType);
if (match != null)
{
// The view models expecting value types shouldn't be given null, avoid that
if (initialValue == null && propertyType.IsValueType)
initialValue = Activator.CreateInstance(propertyType);
var parameters = new IParameter[]
{
new ConstructorArgument("description", description),