From 9f5a1027fd109d59b5519b5146c834e7b5c50668 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Mon, 20 Nov 2023 10:34:46 +0100 Subject: [PATCH] Warning cleanup (#13656) Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com> --- build/TrimmingEnable.props | 9 ++++ samples/ControlCatalog/MainView.xaml.cs | 2 +- samples/ControlCatalog/Pages/GesturePage.cs | 6 +-- .../ViewModels/ComboBoxPageViewModel.cs | 4 +- .../PlatformInformationViewModel.cs | 8 +--- src/Avalonia.Base/Collections/AvaloniaList.cs | 5 +- src/Avalonia.Base/Input/InputMethod.cs | 2 +- .../Platform/Storage/FileIO/BclStorageFile.cs | 9 ++-- .../Storage/FileIO/BclStorageFolder.cs | 32 ++++++------- src/Avalonia.Base/Rendering/RenderLoop.cs | 2 - .../Threading/Dispatcher.Queue.cs | 18 +++++-- .../Threading/IDispatcherImpl.cs | 21 +++++--- .../Utilities/AsyncEnumerableHelper.cs | 48 +++++++++++++++++++ src/Avalonia.Controls/ContextMenu.cs | 5 -- src/Avalonia.Controls/MenuItem.cs | 5 -- .../WindowNotificationManager.cs | 2 +- src/Avalonia.Controls/Platform/IWindowImpl.cs | 2 +- src/Avalonia.Controls/ProgressBar.cs | 17 +++---- .../SimpleWebSocketHttpServer.cs | 4 +- .../Remote/RemoteDesignerEntryPoint.cs | 2 - src/Avalonia.DesignerSupport/Remote/Stubs.cs | 9 +++- .../DBusIme/Fcitx/FcitxICWrapper.cs | 19 ++++---- .../DBusIme/Fcitx/FcitxX11TextInputMethod.cs | 6 +-- src/Avalonia.FreeDesktop/DBusMenuExporter.cs | 8 ++-- src/Avalonia.Native/DispatcherImpl.cs | 7 ++- src/Avalonia.Native/WindowImpl.cs | 4 -- src/Avalonia.Native/WindowImplBase.cs | 2 +- src/Avalonia.X11/Glx/GlxContext.cs | 26 +++++----- .../Screens/X11Screen.Providers.cs | 19 +++++--- .../Screens/X11Screens.Scaling.cs | 2 +- src/Avalonia.X11/X11Window.Xim.cs | 5 +- src/Avalonia.X11/X11Window.cs | 12 +++-- src/Avalonia.X11/XResources.cs | 6 +-- .../AvaloniaTestApplicationAttribute.cs | 1 + .../Avalonia.Headless/HeadlessWindowImpl.cs | 2 +- .../LinuxFramebufferPlatform.cs | 4 +- .../XamlIncludeGroupTransformer.cs | 2 +- .../AvaloniaXAmlIlClassesTransformer.cs | 8 ++-- .../IncludeXamlIlSre.props | 3 -- .../Avalonia.Markup.Xaml.csproj | 1 + .../FramebufferShimRenderTarget.cs | 5 +- .../Compiler/MiniCompiler.cs | 2 + .../Compiler/RoslynTypeSystem.cs | 3 ++ .../Avalonia.Generators/TrimmingMessages.cs | 6 +++ .../Generator.ConfigHelpers.cs | 15 +++--- 45 files changed, 230 insertions(+), 150 deletions(-) create mode 100644 src/Avalonia.Base/Utilities/AsyncEnumerableHelper.cs create mode 100644 src/tools/Avalonia.Generators/TrimmingMessages.cs diff --git a/build/TrimmingEnable.props b/build/TrimmingEnable.props index 3f873e3345..fcd4b45e4b 100644 --- a/build/TrimmingEnable.props +++ b/build/TrimmingEnable.props @@ -1,10 +1,12 @@ + false true false true + true @@ -13,4 +15,11 @@ $(WarningsAsErrors);IL3050;IL3051;IL3052;IL3053;IL3054;IL3055;IL3056 + + + + true + false + + diff --git a/samples/ControlCatalog/MainView.xaml.cs b/samples/ControlCatalog/MainView.xaml.cs index 801844a43c..31fa54a23a 100644 --- a/samples/ControlCatalog/MainView.xaml.cs +++ b/samples/ControlCatalog/MainView.xaml.cs @@ -59,7 +59,7 @@ namespace ControlCatalog { if (flowDirections.SelectedItem is FlowDirection flowDirection) { - TopLevel.GetTopLevel(this).FlowDirection = flowDirection; + TopLevel.GetTopLevel(this)!.FlowDirection = flowDirection; } }; diff --git a/samples/ControlCatalog/Pages/GesturePage.cs b/samples/ControlCatalog/Pages/GesturePage.cs index c81ba4fb17..c276397a4d 100644 --- a/samples/ControlCatalog/Pages/GesturePage.cs +++ b/samples/ControlCatalog/Pages/GesturePage.cs @@ -41,12 +41,12 @@ namespace ControlCatalog.Pages SetPullHandlers(this.Find("RightPullZone"), true); SetPullHandlers(this.Find("LeftPullZone"), false); - var image = this.Find("PinchImage"); + var image = this.Get("PinchImage"); SetPinchHandlers(image); - var reset = this.Find