mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Shared UI - Resolved all remaining warnings
UI - Resolved all remaining warnings Layer properties - Fixed DisableKeyframes layer property attribute not being applied
This commit is contained in:
1 parent
931b43aa66
commit
8d901027ee
75 files changed
+810
-562
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using Artemis.Core;
|
||||
@@ -10,14 +10,14 @@ using Stylet;
|
||||
|
||||
namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
{
|
||||
public class DataModelDebugViewModel : Screen
|
||||
public sealed class DataModelDebugViewModel : Screen, IDisposable
|
||||
{
|
||||
private readonly IDataModelUIService _dataModelUIService;
|
||||
private readonly IPluginManagementService _pluginManagementService;
|
||||
private readonly Timer _updateTimer;
|
||||
|
||||
private bool _isModuleFilterEnabled;
|
||||
private DataModelPropertiesViewModel _mainDataModel;
|
||||
private List<Module> _modules;
|
||||
private string _propertySearch;
|
||||
private Module _selectedModule;
|
||||
|
||||
@@ -69,6 +69,17 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
}
|
||||
}
|
||||
|
||||
#region Overrides of Screen
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnClose()
|
||||
{
|
||||
_updateTimer.Dispose();
|
||||
base.OnClose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
GetDataModel();
|
||||
@@ -126,5 +137,15 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
||||
else if (!SelectedModule.IsEnabled)
|
||||
SelectedModule = null;
|
||||
}
|
||||
|
||||
#region IDisposable
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
_updateTimer?.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ namespace Artemis.UI.Screens.Settings.Tabs.Devices
|
||||
{
|
||||
private readonly ISettingsVmFactory _settingsVmFactory;
|
||||
private readonly ISurfaceService _surfaceService;
|
||||
private BindableCollection<DeviceSettingsViewModel> _deviceSettingsViewModels;
|
||||
|
||||
public DeviceSettingsTabViewModel(ISurfaceService surfaceService, ISettingsVmFactory settingsVmFactory)
|
||||
{
|
||||
|
||||
@@ -125,34 +125,27 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
|
||||
private PackIconKind GetIconKind()
|
||||
{
|
||||
switch (Feature)
|
||||
return Feature switch
|
||||
{
|
||||
case BaseDataModelExpansion _:
|
||||
return PackIconKind.TableAdd;
|
||||
case DeviceProvider _:
|
||||
return PackIconKind.Devices;
|
||||
case ProfileModule _:
|
||||
return PackIconKind.VectorRectangle;
|
||||
case Module _:
|
||||
return PackIconKind.GearBox;
|
||||
case LayerBrushProvider _:
|
||||
return PackIconKind.Brush;
|
||||
case LayerEffectProvider _:
|
||||
return PackIconKind.AutoAwesome;
|
||||
}
|
||||
|
||||
return PackIconKind.Plugin;
|
||||
BaseDataModelExpansion => PackIconKind.TableAdd,
|
||||
DeviceProvider => PackIconKind.Devices,
|
||||
ProfileModule => PackIconKind.VectorRectangle,
|
||||
Module => PackIconKind.GearBox,
|
||||
LayerBrushProvider => PackIconKind.Brush,
|
||||
LayerEffectProvider => PackIconKind.AutoAwesome,
|
||||
_ => PackIconKind.Plugin
|
||||
};
|
||||
}
|
||||
|
||||
#region Event handlers
|
||||
|
||||
private void OnFeatureEnabling(object? sender, PluginFeatureEventArgs e)
|
||||
private void OnFeatureEnabling(object sender, PluginFeatureEventArgs e)
|
||||
{
|
||||
if (e.PluginFeature != Feature) return;
|
||||
Enabling = true;
|
||||
}
|
||||
|
||||
private void OnFeatureEnableStopped(object? sender, PluginFeatureEventArgs e)
|
||||
private void OnFeatureEnableStopped(object sender, PluginFeatureEventArgs e)
|
||||
{
|
||||
if (e.PluginFeature != Feature) return;
|
||||
Enabling = false;
|
||||
|
||||
@@ -146,14 +146,14 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
NotifyOfPropertyChange(nameof(CanOpenSettings));
|
||||
}
|
||||
|
||||
private void PluginOnFeatureRemoved(object? sender, PluginFeatureEventArgs e)
|
||||
private void PluginOnFeatureRemoved(object sender, PluginFeatureEventArgs e)
|
||||
{
|
||||
PluginFeatureViewModel viewModel = Items.FirstOrDefault(i => i.Feature == e.PluginFeature);
|
||||
if (viewModel != null)
|
||||
Items.Remove(viewModel);
|
||||
}
|
||||
|
||||
private void PluginOnFeatureAdded(object? sender, PluginFeatureEventArgs e)
|
||||
private void PluginOnFeatureAdded(object sender, PluginFeatureEventArgs e)
|
||||
{
|
||||
Items.Add(_settingsVmFactory.CreatePluginFeatureViewModel(e.PluginFeature));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user