From 1bd4efbbc52ddaf4c43946875d479404c665184f Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 18 Oct 2023 23:13:57 +0200 Subject: [PATCH] Meta - Fixed a bunch of build warnings --- src/Artemis.Core/Constants.cs | 3 +- .../ProfileConfiguration.cs | 1 - .../Models/Surface/ArtemisDevice.cs | 5 +- .../Services/PluginManagementService.cs | 2 +- .../Services/ProcessMonitoring/ProcessInfo.cs | 35 ++++++-- .../LostFocusTextBoxBindingBehavior.cs | 4 +- .../Controls/DeviceVisualizer.cs | 2 +- .../Controls/Pagination/Pagination.cs | 60 ++++++------- .../Controls/TagsInput/TagsInput.cs | 41 +++++---- .../Exceptions/ArtemisRoutingException.cs | 3 + .../Extensions/HttpClientExtensions.cs | 86 +++++++++++-------- .../Services/Window/WindowService.cs | 8 +- src/Artemis.UI.Shared/Utilities.cs | 3 + src/Artemis.UI/ArtemisBootstrapper.cs | 8 +- .../Device/Tabs/DeviceGeneralTabViewModel.cs | 17 ++-- .../Device/Tabs/DeviceLayoutTabView.axaml.cs | 15 ++-- .../DeviceLogicalLayoutDialogView.axaml.cs | 4 +- .../SingleLedAdaptionHintViewModel.cs | 2 +- .../ProfileTree/ProfileTreeView.axaml.cs | 11 +-- src/Artemis.UI/Screens/Root/RootView.axaml.cs | 2 +- .../Settings/Tabs/ReleasesTabView.axaml.cs | 2 +- .../ProfileConfigurationEditViewModel.cs | 5 +- .../Sidebar/SidebarCategoryView.axaml.cs | 9 +- .../Workshop/Home/WorkshopOfflineViewModel.cs | 8 +- .../Converters/JsonConverter.cs | 7 +- .../Screens/EnumEqualsNodeCustomViewModel.cs | 2 +- .../Entities/RefreshTokenEntity.cs | 3 +- 27 files changed, 199 insertions(+), 149 deletions(-) diff --git a/src/Artemis.Core/Constants.cs b/src/Artemis.Core/Constants.cs index b5341f3e5..ba47fd52c 100644 --- a/src/Artemis.Core/Constants.cs +++ b/src/Artemis.Core/Constants.cs @@ -151,8 +151,7 @@ public static class Constants public static ReadOnlyCollection StartupArguments { get; set; } = null!; /// - /// Gets the graphics context to be used for rendering by SkiaSharp. Can be set via - /// . + /// Gets the graphics context to be used for rendering by SkiaSharp. /// public static IManagedGraphicsContext? ManagedGraphicsContext { get; internal set; } } \ No newline at end of file diff --git a/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs b/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs index b0dec1d29..04f84c8f1 100644 --- a/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs +++ b/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs @@ -23,7 +23,6 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable private bool _disposed; private Hotkey? _enableHotkey; private ProfileConfigurationHotkeyMode _hotkeyMode; - private bool _isBeingEdited; private bool _isMissingModule; private bool _isSuspended; private bool _fadeInAndOut; diff --git a/src/Artemis.Core/Models/Surface/ArtemisDevice.cs b/src/Artemis.Core/Models/Surface/ArtemisDevice.cs index 914b461c5..d34a3cd7d 100644 --- a/src/Artemis.Core/Models/Surface/ArtemisDevice.cs +++ b/src/Artemis.Core/Models/Surface/ArtemisDevice.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Linq; using Artemis.Core.DeviceProviders; +using Artemis.Core.Services; using Artemis.Storage.Entities.Surface; using RGB.NET.Core; using SkiaSharp; @@ -266,7 +267,7 @@ public class ArtemisDevice : CorePropertyChanged /// /// Gets a boolean indicating whether this devices is enabled or not - /// Note: To enable/disable a device use the methods provided by + /// Note: To enable/disable a device use the methods provided by /// public bool IsEnabled { @@ -320,7 +321,7 @@ public class ArtemisDevice : CorePropertyChanged } /// - /// Gets or sets the path of the custom layout to load when calling + /// Gets or sets the path of the custom layout to load when calling /// for this device /// public string? CustomLayoutPath diff --git a/src/Artemis.Core/Services/PluginManagementService.cs b/src/Artemis.Core/Services/PluginManagementService.cs index 964f5b0dd..639aa014f 100644 --- a/src/Artemis.Core/Services/PluginManagementService.cs +++ b/src/Artemis.Core/Services/PluginManagementService.cs @@ -31,7 +31,7 @@ internal class PluginManagementService : IPluginManagementService private readonly IPluginRepository _pluginRepository; private readonly List _plugins; private readonly IQueuedActionRepository _queuedActionRepository; - private FileSystemWatcher _hotReloadWatcher; + private FileSystemWatcher? _hotReloadWatcher; private bool _disposed; private bool _isElevated; diff --git a/src/Artemis.Core/Services/ProcessMonitoring/ProcessInfo.cs b/src/Artemis.Core/Services/ProcessMonitoring/ProcessInfo.cs index c4cc6de1b..4c71c63e0 100644 --- a/src/Artemis.Core/Services/ProcessMonitoring/ProcessInfo.cs +++ b/src/Artemis.Core/Services/ProcessMonitoring/ProcessInfo.cs @@ -1,24 +1,49 @@ namespace Artemis.Core.Services; +/// +/// This readonly struct provides information about a process. +/// public readonly struct ProcessInfo { #region Properties & Fields + /// + /// Gets the Identifier for the process. + /// public readonly int ProcessId; + + /// + /// Gets the name of the process. + /// public readonly string ProcessName; - public readonly string ImageName; //TODO DarthAffe 01.09.2023: Do we need this if we can't get it through Process.GetProcesses()? + + /// + /// Gets the Image Name of the Process. + /// + public readonly string ImageName; // TODO DarthAffe 01.09.2023: Do we need this if we can't get it through Process.GetProcesses()? + + /// + /// Gets the Executable associated with the Process. + /// public readonly string Executable; #endregion #region Constructors + /// + /// Initializes a new instance of the struct. + /// + /// The identifier for the process. + /// The name of the process. + /// The Image Name of the process. + /// The executable associated with the process. public ProcessInfo(int processId, string processName, string imageName, string executable) { - this.ProcessId = processId; - this.ProcessName = processName; - this.ImageName = imageName; - this.Executable = executable; + ProcessId = processId; + ProcessName = processName; + ImageName = imageName; + Executable = executable; } #endregion diff --git a/src/Artemis.UI.Shared/Behaviors/LostFocusTextBoxBindingBehavior.cs b/src/Artemis.UI.Shared/Behaviors/LostFocusTextBoxBindingBehavior.cs index 4c095741c..f6a8f6ad1 100644 --- a/src/Artemis.UI.Shared/Behaviors/LostFocusTextBoxBindingBehavior.cs +++ b/src/Artemis.UI.Shared/Behaviors/LostFocusTextBoxBindingBehavior.cs @@ -15,7 +15,7 @@ public class LostFocusTextBoxBindingBehavior : Behavior /// /// Gets or sets the value of the binding. /// - public static readonly StyledProperty TextProperty = AvaloniaProperty.Register( + public static readonly StyledProperty TextProperty = AvaloniaProperty.Register( "Text", defaultBindingMode: BindingMode.TwoWay); static LostFocusTextBoxBindingBehavior() @@ -26,7 +26,7 @@ public class LostFocusTextBoxBindingBehavior : Behavior /// /// Gets or sets the value of the binding. /// - public string Text + public string? Text { get => GetValue(TextProperty); set => SetValue(TextProperty, value); diff --git a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs index 46db27445..c21f91d58 100644 --- a/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs +++ b/src/Artemis.UI.Shared/Controls/DeviceVisualizer.cs @@ -305,7 +305,7 @@ public class DeviceVisualizer : Control { _deviceImage = await Task.Run(() => GetDeviceImage(device)); } - catch (Exception e) + catch (Exception) { // ignored } diff --git a/src/Artemis.UI.Shared/Controls/Pagination/Pagination.cs b/src/Artemis.UI.Shared/Controls/Pagination/Pagination.cs index 35b4fa96e..5a193f958 100644 --- a/src/Artemis.UI.Shared/Controls/Pagination/Pagination.cs +++ b/src/Artemis.UI.Shared/Controls/Pagination/Pagination.cs @@ -19,32 +19,32 @@ namespace Artemis.UI.Shared.Pagination; [TemplatePart("PART_PagesView", typeof(StackPanel))] public partial class Pagination : TemplatedControl { + private Button? _previousButton; + private Button? _nextButton; + private StackPanel? _pagesView; + /// public Pagination() { PropertyChanged += OnPropertyChanged; } - public Button? PreviousButton { get; set; } - public Button? NextButton { get; set; } - public StackPanel? PagesView { get; set; } - /// protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { - if (PreviousButton != null) - PreviousButton.Click -= PreviousButtonOnClick; - if (NextButton != null) - NextButton.Click -= NextButtonOnClick; + if (_previousButton != null) + _previousButton.Click -= PreviousButtonOnClick; + if (_nextButton != null) + _nextButton.Click -= NextButtonOnClick; - PreviousButton = e.NameScope.Find