From 86dc4042ab99b2340365fa57c629c2c2dad95e8f Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Wed, 1 Feb 2023 16:52:58 +0100 Subject: [PATCH] fix: misc warning - Warning CA1815 PlatformGraphicsExternalImageProperties should override Equals Avalonia.Base (net6.0) \src\Avalonia.Base\Platform\PlatformGraphicsExternalMemory.cs 7 N/A - Warning CA1823 Unused field 'ProximityPoints' Avalonia.Controls (net6.0) src\Avalonia.Controls\Presenters\ScrollContentPresenter.cs 18 N/A - Warning CS0169 The field 'VulkanDemoControl._vkInstance' is never used GpuInterop samples\GpuInterop\VulkanDemo\VulkanDemoControl.cs 19 N/A - Warning CS0169 The field 'VulkanDemoControl._api' is never used GpuInterop samples\GpuInterop\VulkanDemo\VulkanDemoControl.cs 20 N/A - Warning CS0219 The variable 'isZooming' is assigned but its value is never used ControlCatalog (netstandard2.0) samples\ControlCatalog\Pages\GesturePage.cs 73 N/A - Warning xUnit2004 Do not use Assert.Equal() to check for boolean conditions. Avalonia.IntegrationTests.Appium tests\Avalonia.IntegrationTests.Appium\WindowTests_MacOS.cs 267 N/A --- samples/ControlCatalog/Pages/GesturePage.cs | 1 - samples/GpuInterop/VulkanDemo/VulkanDemoControl.cs | 12 ------------ .../Platform/PlatformGraphicsExternalMemory.cs | 6 +----- .../Presenters/ScrollContentPresenter.cs | 1 - .../WindowTests_MacOS.cs | 2 +- 5 files changed, 2 insertions(+), 20 deletions(-) diff --git a/samples/ControlCatalog/Pages/GesturePage.cs b/samples/ControlCatalog/Pages/GesturePage.cs index 0bb8f38219..cc4429f414 100644 --- a/samples/ControlCatalog/Pages/GesturePage.cs +++ b/samples/ControlCatalog/Pages/GesturePage.cs @@ -70,7 +70,6 @@ namespace ControlCatalog.Pages _currentScale = 1; Vector3 currentOffset = default; - bool isZooming = false; CompositionVisual? compositionVisual = null; diff --git a/samples/GpuInterop/VulkanDemo/VulkanDemoControl.cs b/samples/GpuInterop/VulkanDemo/VulkanDemoControl.cs index 6a1cd641b3..962b4e433a 100644 --- a/samples/GpuInterop/VulkanDemo/VulkanDemoControl.cs +++ b/samples/GpuInterop/VulkanDemo/VulkanDemoControl.cs @@ -1,24 +1,12 @@ using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; using System.Threading.Tasks; using Avalonia; -using Avalonia.Platform; using Avalonia.Rendering.Composition; -using Silk.NET.Core; -using Silk.NET.Vulkan; -using Silk.NET.Vulkan.Extensions.KHR; -using SilkNetDemo; namespace GpuInterop.VulkanDemo; public class VulkanDemoControl : DrawingSurfaceDemoBase { - private Instance _vkInstance; - private Vk _api; - class VulkanResources : IAsyncDisposable { public VulkanContext Context { get; } diff --git a/src/Avalonia.Base/Platform/PlatformGraphicsExternalMemory.cs b/src/Avalonia.Base/Platform/PlatformGraphicsExternalMemory.cs index cad4ab2051..4b47c93eb5 100644 --- a/src/Avalonia.Base/Platform/PlatformGraphicsExternalMemory.cs +++ b/src/Avalonia.Base/Platform/PlatformGraphicsExternalMemory.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - namespace Avalonia.Platform; -public struct PlatformGraphicsExternalImageProperties +public record struct PlatformGraphicsExternalImageProperties { public int Width { get; set; } public int Height { get; set; } diff --git a/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs b/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs index 762702efcc..454f7eac9d 100644 --- a/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs +++ b/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs @@ -15,7 +15,6 @@ namespace Avalonia.Controls.Presenters public class ScrollContentPresenter : ContentPresenter, IPresenter, IScrollable, IScrollAnchorProvider { private const double EdgeDetectionTolerance = 0.1; - private const int ProximityPoints = 10; /// /// Defines the property. diff --git a/tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs b/tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs index 6c61a85561..d9817ecdd1 100644 --- a/tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs +++ b/tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs @@ -264,7 +264,7 @@ namespace Avalonia.IntegrationTests.Appium var secondaryWindow = GetWindow("SecondaryWindow"); var (_, miniaturizeButton, _) = secondaryWindow.GetChromeButtons(); - Assert.Equal(false, miniaturizeButton.Enabled); + Assert.False(miniaturizeButton.Enabled); } }