mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Merge branch 'development' into feature/cpm
This commit is contained in:
commit
d0e354952d
235 files changed
+645
-6611
No files matched your search
@@ -18,16 +18,20 @@ internal class DataModelUIService : IDataModelUIService
|
||||
private readonly IContainer _container;
|
||||
private readonly List<DataModelVisualizationRegistration> _registeredDataModelDisplays;
|
||||
private readonly List<DataModelVisualizationRegistration> _registeredDataModelEditors;
|
||||
private readonly PluginSetting<bool> _showFullPaths;
|
||||
private readonly PluginSetting<bool> _showDataModelValues;
|
||||
|
||||
public DataModelUIService(IDataModelService dataModelService, IContainer container)
|
||||
public DataModelUIService(IDataModelService dataModelService, IContainer container, ISettingsService settingsService)
|
||||
{
|
||||
_dataModelService = dataModelService;
|
||||
_container = container;
|
||||
_registeredDataModelEditors = new List<DataModelVisualizationRegistration>();
|
||||
_registeredDataModelDisplays = new List<DataModelVisualizationRegistration>();
|
||||
|
||||
|
||||
RegisteredDataModelEditors = new ReadOnlyCollection<DataModelVisualizationRegistration>(_registeredDataModelEditors);
|
||||
RegisteredDataModelDisplays = new ReadOnlyCollection<DataModelVisualizationRegistration>(_registeredDataModelDisplays);
|
||||
ShowFullPaths = settingsService.GetSetting("ProfileEditor.ShowFullPaths", true);
|
||||
ShowDataModelValues = settingsService.GetSetting("ProfileEditor.ShowDataModelValues", false);
|
||||
}
|
||||
|
||||
private DataModelInputViewModel InstantiateDataModelInputViewModel(DataModelVisualizationRegistration registration, DataModelPropertyAttribute? description, object? initialValue)
|
||||
@@ -43,7 +47,9 @@ internal class DataModelUIService : IDataModelUIService
|
||||
|
||||
public IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelEditors { get; }
|
||||
public IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelDisplays { get; }
|
||||
|
||||
public PluginSetting<bool> ShowFullPaths { get; }
|
||||
public PluginSetting<bool> ShowDataModelValues { get; }
|
||||
|
||||
public DataModelPropertiesViewModel GetMainDataModelVisualization()
|
||||
{
|
||||
DataModelPropertiesViewModel viewModel = new(null, null, null);
|
||||
|
||||
@@ -104,4 +104,14 @@ public interface IDataModelUIService : IArtemisSharedUIService
|
||||
/// <param name="updateCallback">A function to call whenever the input was updated (submitted or not)</param>
|
||||
/// <returns>The most appropriate input view model for the provided <paramref name="propertyType" /></returns>
|
||||
DataModelInputViewModel? GetDataModelInputViewModel(Type propertyType, DataModelPropertyAttribute? description, object? initialValue, Action<object?, bool> updateCallback);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether or not to show full paths when displaying data model paths.
|
||||
/// </summary>
|
||||
PluginSetting<bool> ShowFullPaths { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating whether or not to show values when displaying data model paths.
|
||||
/// </summary>
|
||||
PluginSetting<bool> ShowDataModelValues { get; }
|
||||
}
|
||||
@@ -27,6 +27,7 @@ public class AddNode : INodeEditorCommand, IDisposable
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global - Provided by plugins
|
||||
if (_isRemoved && _node is IDisposable disposableNode)
|
||||
disposableNode.Dispose();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class DeleteNode : INodeEditorCommand, IDisposable
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global - Provided by plugins
|
||||
if (_isRemoved && _node is IDisposable disposableNode)
|
||||
disposableNode.Dispose();
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DuplicateNode : INodeEditorCommand, IDisposable
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global - Provided by plugins
|
||||
if (!_executed && _copy is IDisposable disposableNode)
|
||||
disposableNode.Dispose();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user