Meta - Fixed a bunch of build warnings

This commit is contained in:
Robert committed 2023-10-18 23:13:57 +02:00
1 parent 6921561317
commit 1bd4efbbc5
27 files changed
+199 -149

No files matched your search

@@ -1,15 +1,10 @@
using Artemis.UI.Shared;
using Artemis.UI.Shared;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reactive.Disposables;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using ReactiveUI;
using RGB.NET.Core;
@@ -50,10 +45,10 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
Device = device;
DisplayName = "General";
X = (int)Device.X;
Y = (int)Device.Y;
X = (int) Device.X;
Y = (int) Device.Y;
Scale = Device.Scale;
Rotation = (int)Device.Rotation;
Rotation = (int) Device.Rotation;
RedScale = Device.RedScale * 100f;
GreenScale = Device.GreenScale * 100f;
BlueScale = Device.BlueScale * 100f;
@@ -234,7 +229,7 @@ public class DeviceGeneralTabViewModel : ActivatableViewModelBase
if (!DisplayOnDevices)
return;
using SKPaint overlayPaint = new() { Color = CurrentColor };
using SKPaint overlayPaint = new() {Color = CurrentColor};
e.Canvas.DrawRect(0, 0, e.Canvas.LocalClipBounds.Width, e.Canvas.LocalClipBounds.Height, overlayPaint);
}
}
@@ -1,8 +1,5 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Device;
@@ -18,17 +15,17 @@ public partial class DeviceLayoutTabView : ReactiveUserControl<DeviceLayoutTabVi
{
if (ViewModel?.DefaultLayoutPath is null)
return;
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel.DefaultLayoutPath);
TopLevel.GetTopLevel(this)?.Clipboard?.SetTextAsync(ViewModel.DefaultLayoutPath);
ViewModel.ShowCopiedNotification();
}
private void ImagePathButton_OnClick(object? sender, RoutedEventArgs e)
{
if (ViewModel?.Device?.Layout?.Image?.LocalPath is null)
if (ViewModel?.Device.Layout?.Image?.LocalPath is null)
return;
TopLevel.GetTopLevel(this).Clipboard.SetTextAsync(ViewModel.Device.Layout.Image.LocalPath);
TopLevel.GetTopLevel(this)?.Clipboard?.SetTextAsync(ViewModel.Device.Layout.Image.LocalPath);
ViewModel.ShowCopiedNotification();
}
}
@@ -25,8 +25,10 @@ public partial class DeviceLogicalLayoutDialogView : ReactiveUserControl<DeviceL
RegionsAutoCompleteBox.PopulateComplete();
}
private bool SearchRegions(string search, object item)
private bool SearchRegions(string? search, object? item)
{
if (search == null)
return true;
if (item is not RegionInfo regionInfo)
return false;