mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Data model debugger - Added module filtering
Data model debugger - Added search input (disabled & not yet implemented) Data model debugger - Finished list support
This commit is contained in:
1 parent
ac45c4d5d3
commit
3bc1da8ca6
10 files changed
+198
-47
No files matched your search
@@ -33,7 +33,7 @@ namespace Artemis.UI.DataModelVisualization
|
||||
foreach (var item in List)
|
||||
{
|
||||
DataModelVisualizationViewModel child;
|
||||
if (Children.Count < index)
|
||||
if (Children.Count <= index)
|
||||
{
|
||||
child = CreateChild(item);
|
||||
Children.Add(child);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
|
||||
namespace Artemis.UI.DataModelVisualization
|
||||
@@ -12,25 +11,13 @@ namespace Artemis.UI.DataModelVisualization
|
||||
Parent = parent;
|
||||
PropertyDescription = propertyDescription;
|
||||
}
|
||||
|
||||
public bool IsListProperty { get; set; }
|
||||
public string ListDescription { get; set; }
|
||||
public Type PropertyType { get; set; }
|
||||
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (PropertyInfo != null && Parent?.Model != null)
|
||||
{
|
||||
IsListProperty = false;
|
||||
Model = PropertyInfo.GetValue(Parent.Model);
|
||||
PropertyType = PropertyInfo.PropertyType;
|
||||
}
|
||||
else if (Parent is DataModelListViewModel listViewModel)
|
||||
{
|
||||
IsListProperty = true;
|
||||
ListDescription = $"List item [{listViewModel.List.IndexOf(Model)}]";
|
||||
PropertyType = Model.GetType();
|
||||
}
|
||||
|
||||
UpdateListStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using Artemis.Core.Extensions;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
using Humanizer;
|
||||
using Stylet;
|
||||
|
||||
namespace Artemis.UI.DataModelVisualization
|
||||
@@ -45,6 +43,8 @@ namespace Artemis.UI.DataModelVisualization
|
||||
|
||||
foreach (var dataModelVisualizationViewModel in Children)
|
||||
dataModelVisualizationViewModel.Update();
|
||||
|
||||
UpdateListStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,16 @@ namespace Artemis.UI.DataModelVisualization
|
||||
{
|
||||
public abstract class DataModelVisualizationViewModel : PropertyChangedBase
|
||||
{
|
||||
public PropertyInfo PropertyInfo { get; protected set; }
|
||||
public DataModelPropertyAttribute PropertyDescription { get; protected set; }
|
||||
public PropertyInfo PropertyInfo { get; protected set; }
|
||||
public Type PropertyType { get; set; }
|
||||
|
||||
public DataModelVisualizationViewModel Parent { get; protected set; }
|
||||
public object Model { get; set; }
|
||||
|
||||
public bool IsListProperty { get; set; }
|
||||
public string ListDescription { get; set; }
|
||||
|
||||
public abstract void Update();
|
||||
|
||||
protected DataModelVisualizationViewModel CreateChild(PropertyInfo propertyInfo)
|
||||
@@ -59,5 +64,20 @@ namespace Artemis.UI.DataModelVisualization
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void UpdateListStatus()
|
||||
{
|
||||
if (Parent is DataModelListViewModel listViewModel)
|
||||
{
|
||||
IsListProperty = true;
|
||||
ListDescription = $"List item [{listViewModel.List.IndexOf(Model)}]";
|
||||
PropertyType = Model.GetType();
|
||||
}
|
||||
else
|
||||
{
|
||||
IsListProperty = false;
|
||||
PropertyType = PropertyInfo?.PropertyType;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user