Przeglądaj źródła

Fixes to a couple bugs with filters

Kenric Nugteren 6 miesięcy temu
rodzic
commit
75fba817b8

+ 5 - 0
InABox.Core/Query/Filter.cs

@@ -2039,6 +2039,11 @@ namespace InABox.Core
             var result = (Activator.CreateInstance(finaltype) as IFilter)!;
 
             var prop = data["Expression"].ToString();
+            if (prop.StartsWith('{'))
+            {
+                var exp = CoreUtils.StringToExpression(prop);
+                prop = CoreUtils.ExpressionToString(typeof(object), exp);
+            }
             var op = (Operator)int.Parse(data["Operator"].ToString());
 
             if(data.TryGetValue("IsNot", out var isNotValue) && isNotValue is bool b)

+ 1 - 1
inabox.wpf/DynamicGrid/Editors/FilterEditor/Nodes/PropertyNode.cs

@@ -52,7 +52,7 @@ public class PropertyNode<T> : Button
             .ToList();
         properties.Sort();
         ColumnNames = properties.ToArray();
-        SelectedProperty = property;
+        SelectedProperty = properties.Contains(property) ? property : null;
 
         Click += PropertyNode_Click;
     }