1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Meta - Update RGB.NET

Meta - Fixed warnings
This commit is contained in:
Robert 2023-01-11 22:33:47 +01:00
parent ef5a9fa88d
commit 166cb888c1
16 changed files with 29 additions and 23 deletions

View File

@ -44,9 +44,9 @@
<PackageReference Include="Ninject" Version="3.3.6" /> <PackageReference Include="Ninject" Version="3.3.6" />
<PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" /> <PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" /> <PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="RGB.NET.Presets" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Presets" Version="1.0.0" />
<PackageReference Include="Serilog" Version="2.11.0" /> <PackageReference Include="Serilog" Version="2.11.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" /> <PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />

View File

@ -62,8 +62,8 @@ public static class Constants
/// <summary> /// <summary>
/// The current API version for plugins /// The current API version for plugins
/// </summary> /// </summary>
public static readonly int PluginApiVersion = int.Parse(CoreAssembly.GetCustomAttributes<AssemblyMetadataAttribute>() public static readonly int PluginApiVersion = int.Parse(CoreAssembly.GetCustomAttributes<AssemblyMetadataAttribute>().First(a => a.Key == "PluginApiVersion").Value ??
.First(a => a.Key == "PluginApiVersion").Value); throw new InvalidOperationException("Cannot find PluginApiVersion metadata in assembly"));
/// <summary> /// <summary>
/// The plugin info used by core components of Artemis /// The plugin info used by core components of Artemis

View File

@ -10,9 +10,9 @@ namespace Artemis.Core.JsonConverters
/// </summary> /// </summary>
internal class ForgivingVersionConverter : VersionConverter internal class ForgivingVersionConverter : VersionConverter
{ {
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{ {
object obj = base.ReadJson(reader, objectType, existingValue, serializer); object? obj = base.ReadJson(reader, objectType, existingValue, serializer);
if (obj is not Version v) if (obj is not Version v)
return obj; return obj;

View File

@ -18,7 +18,6 @@ namespace Artemis.Core;
public class PluginFeatureInfo : CorePropertyChanged, IPrerequisitesSubject public class PluginFeatureInfo : CorePropertyChanged, IPrerequisitesSubject
{ {
private string? _description; private string? _description;
private string? _icon;
private PluginFeature? _instance; private PluginFeature? _instance;
private Exception? _loadException; private Exception? _loadException;
private string _name = null!; private string _name = null!;

View File

@ -8,7 +8,10 @@ namespace Artemis.Core.Services;
/// </summary> /// </summary>
public abstract class InputProvider : IDisposable public abstract class InputProvider : IDisposable
{ {
public InputProvider() /// <summary>
/// Creates a new instance of the <see cref="InputProvider"/> class.
/// </summary>
protected InputProvider()
{ {
ProviderName = GetType().FullName ?? throw new InvalidOperationException("Input provider must have a type with a name"); ProviderName = GetType().FullName ?? throw new InvalidOperationException("Input provider must have a type with a name");
} }

View File

@ -97,7 +97,7 @@ public interface INode : INotifyPropertyChanged, IBreakableModel
void TryEvaluate(); void TryEvaluate();
/// <summary> /// <summary>
/// Resets the node causing all pins to re-evaluate the next time <see cref="Evaluate" /> is called /// Resets the node causing all pins to re-evaluate the next time <see cref="TryEvaluate" /> is called
/// </summary> /// </summary>
void Reset(); void Reset();
} }

View File

@ -20,7 +20,7 @@
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -317,7 +317,7 @@ public class DeviceVisualizer : Control
Dispatcher.UIThread.Post(InvalidateMeasure); Dispatcher.UIThread.Post(InvalidateMeasure);
} }
catch (Exception e) catch (Exception)
{ {
// ignored // ignored
} }

View File

@ -18,7 +18,7 @@ namespace Artemis.UI.Shared.DataModelVisualization.Shared;
/// </summary> /// </summary>
public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposable public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposable
{ {
private const int MaxDepth = 4; private const int MAX_DEPTH = 4;
private ObservableCollection<DataModelVisualizationViewModel> _children; private ObservableCollection<DataModelVisualizationViewModel> _children;
private DataModel? _dataModel; private DataModel? _dataModel;
private bool _isMatchingFilteredTypes; private bool _isMatchingFilteredTypes;
@ -47,6 +47,9 @@ public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposa
PropertyDescription = DataModelPath?.GetPropertyDescription() ?? DataModel?.DataModelDescription; PropertyDescription = DataModelPath?.GetPropertyDescription() ?? DataModel?.DataModelDescription;
} }
/// <summary>
/// Copies the path of the data model to the clipboard.
/// </summary>
public ReactiveCommand<Unit, Unit> CopyPath { get; } public ReactiveCommand<Unit, Unit> CopyPath { get; }
/// <summary> /// <summary>
@ -337,7 +340,7 @@ public abstract class DataModelVisualizationViewModel : ReactiveObject, IDisposa
{ {
if (DataModel == null) if (DataModel == null)
throw new ArtemisSharedUIException("Cannot create a data model visualization child VM for a parent without a data model"); throw new ArtemisSharedUIException("Cannot create a data model visualization child VM for a parent without a data model");
if (depth > MaxDepth) if (depth > MAX_DEPTH)
return null; return null;
DataModelPath dataModelPath = new(DataModel, path); DataModelPath dataModelPath = new(DataModel, path);

View File

@ -19,6 +19,9 @@ namespace Artemis.UI.Shared;
/// <typeparam name="TViewModel">ViewModel type.</typeparam> /// <typeparam name="TViewModel">ViewModel type.</typeparam>
public class ReactiveCoreWindow<TViewModel> : CoreWindow, IViewFor<TViewModel> where TViewModel : class public class ReactiveCoreWindow<TViewModel> : CoreWindow, IViewFor<TViewModel> where TViewModel : class
{ {
/// <summary>
/// The ViewModel.
/// </summary>
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty
.Register<ReactiveCoreWindow<TViewModel>, TViewModel?>(nameof(ViewModel)); .Register<ReactiveCoreWindow<TViewModel>, TViewModel?>(nameof(ViewModel));

View File

@ -5,7 +5,7 @@ using Artemis.Core;
namespace Artemis.UI.Shared.Services.ProfileEditor.Commands; namespace Artemis.UI.Shared.Services.ProfileEditor.Commands;
/// <summary> /// <summary>
/// Represents a profile editor command that can be used to update a layer property of type <typeparamref name="T" />. /// Represents a profile editor command that can be used to update a color gradient.
/// </summary> /// </summary>
public class UpdateColorGradient : IProfileEditorCommand public class UpdateColorGradient : IProfileEditorCommand
{ {

View File

@ -29,8 +29,8 @@
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="2.2.1" />
<PackageReference Include="RGB.NET.Core" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Core" Version="1.0.0" />
<PackageReference Include="RGB.NET.Layout" Version="1.0.0-prerelease.46" /> <PackageReference Include="RGB.NET.Layout" Version="1.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" />
<PackageReference Include="Splat.Ninject" Version="14.4.1" /> <PackageReference Include="Splat.Ninject" Version="14.4.1" />
</ItemGroup> </ItemGroup>

View File

@ -92,7 +92,7 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
private void CurrentMainWindowOnClosing(object? sender, EventArgs e) private void CurrentMainWindowOnClosing(object? sender, EventArgs e)
{ {
WindowSizeSetting.Save(); WindowSizeSetting?.Save();
_lifeTime.MainWindow = null; _lifeTime.MainWindow = null;
SidebarViewModel = null; SidebarViewModel = null;
Router.NavigateAndReset.Execute(new EmptyViewModel(this, "blank")).Subscribe(); Router.NavigateAndReset.Execute(new EmptyViewModel(this, "blank")).Subscribe();

View File

@ -139,7 +139,6 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
public ReactiveCommand<Unit, Unit> OpenConditionEditor { get; } public ReactiveCommand<Unit, Unit> OpenConditionEditor { get; }
public ReactiveCommand<Unit, Unit> BrowseBitmapFile { get; } public ReactiveCommand<Unit, Unit> BrowseBitmapFile { get; }
public ReactiveCommand<Unit, Unit> Confirm { get; } public ReactiveCommand<Unit, Unit> Confirm { get; }
public ReactiveCommand<Unit, Unit> Import { get; }
public ReactiveCommand<Unit, Unit> Delete { get; } public ReactiveCommand<Unit, Unit> Delete { get; }
public ReactiveCommand<Unit, Unit> Cancel { get; } public ReactiveCommand<Unit, Unit> Cancel { get; }

View File

@ -117,7 +117,7 @@ public class LayerPropertyNode : Node<LayerPropertyNodeEntity, LayerPropertyNode
/// The bucket might grow a bit over time as the user edits the node but pins won't get lost, enabling undo/redo in the /// The bucket might grow a bit over time as the user edits the node but pins won't get lost, enabling undo/redo in the
/// editor. /// editor.
/// </summary> /// </summary>
private void CreateOrAddOutputPin(Type valueType, string displayName) private new void CreateOrAddOutputPin(Type valueType, string displayName)
{ {
// Grab the first pin from the bucket that isn't on the node yet // Grab the first pin from the bucket that isn't on the node yet
OutputPin? pin = _pinBucket.FirstOrDefault(p => !Pins.Contains(p)); OutputPin? pin = _pinBucket.FirstOrDefault(p => !Pins.Contains(p));

View File

@ -9,7 +9,7 @@ namespace Artemis.VisualScripting.Nodes.List;
public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPredicateNodeCustomViewModel>, IDisposable public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPredicateNodeCustomViewModel>, IDisposable
{ {
private readonly object _scriptLock = new(); private readonly object _scriptLock = new();
private ListOperatorPredicateStartNode _startNode; private readonly ListOperatorPredicateStartNode _startNode;
public ListOperatorPredicateNode() public ListOperatorPredicateNode()
{ {
@ -65,7 +65,7 @@ public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPr
private bool EvaluateItem(object item) private bool EvaluateItem(object item)
{ {
if (Script == null || _startNode == null) if (Script == null)
return false; return false;
_startNode.Item = item; _startNode.Item = item;
@ -100,7 +100,6 @@ public class ListOperatorPredicateNode : Node<ListOperatorEntity, ListOperatorPr
{ {
Script?.Dispose(); Script?.Dispose();
Script = null; Script = null;
_startNode = null;
} }
#endregion #endregion