From e96595731a30805ac4d8e465d3b4d4dbd97781b7 Mon Sep 17 00:00:00 2001 From: Tom Laird-McConnell Date: Fri, 6 Dec 2024 17:37:56 -0800 Subject: [PATCH] remove extra packages references. Rest of package cleanup is in the Packages PR --- .gitignore | 1 + Directory.Build.props | 2 +- src/Consolonia.Blazor/Consolonia.Blazor.csproj | 1 - .../ConsoloniaNotSupportedException.cs | 1 - src/Consolonia.Designer/ConsolePreview.cs | 11 ----------- src/Consolonia.Designer/Consolonia.Designer.csproj | 8 +++----- src/Consolonia.Designer/Extensions.cs | 4 +--- src/Consolonia.Gallery/Consolonia.Gallery.csproj | 1 - src/Consolonia.Gallery/Program.cs | 5 ----- src/Consolonia.NUnit/Consolonia.NUnit.csproj | 1 - .../Consolonia.PlatformSupport.csproj | 5 ----- .../Example.Blazor.Components.csproj | 7 +++---- src/Example.Blazor/Example.Blazor.csproj | 6 ------ src/Tools/Consolonia.PreviewHost/App.axaml.cs | 7 ++++++- .../Properties/launchSettings.json | 13 ------------- 15 files changed, 15 insertions(+), 58 deletions(-) delete mode 100644 src/Tools/Consolonia.PreviewHost/Properties/launchSettings.json diff --git a/.gitignore b/.gitignore index 03d170b3..1cff3edc 100644 --- a/.gitignore +++ b/.gitignore @@ -766,3 +766,4 @@ fabric.properties .idea/ *.sln.iml +/src/Tools/Consolonia.PreviewHost/Properties/launchSettings.json diff --git a/Directory.Build.props b/Directory.Build.props index 4190adb6..b4360b68 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ disable - 11.2 + 11.2.1 https://github.com/jinek/Consolonia/graphs/contributors Text User Interface implementation of Avalonia UI (GUI Framework) Copyright © Evgeny Gorbovoy 2021 - 2022 diff --git a/src/Consolonia.Blazor/Consolonia.Blazor.csproj b/src/Consolonia.Blazor/Consolonia.Blazor.csproj index f6c1dc62..a63a5e60 100644 --- a/src/Consolonia.Blazor/Consolonia.Blazor.csproj +++ b/src/Consolonia.Blazor/Consolonia.Blazor.csproj @@ -10,6 +10,5 @@ - diff --git a/src/Consolonia.Core/Infrastructure/ConsoloniaNotSupportedException.cs b/src/Consolonia.Core/Infrastructure/ConsoloniaNotSupportedException.cs index d71b502b..f750627e 100644 --- a/src/Consolonia.Core/Infrastructure/ConsoloniaNotSupportedException.cs +++ b/src/Consolonia.Core/Infrastructure/ConsoloniaNotSupportedException.cs @@ -2,7 +2,6 @@ namespace Consolonia.Core.Infrastructure { - [Serializable] public class ConsoloniaNotSupportedException : Exception { internal ConsoloniaNotSupportedException(NotSupportedRequest request) diff --git a/src/Consolonia.Designer/ConsolePreview.cs b/src/Consolonia.Designer/ConsolePreview.cs index 92a40bb9..5be89b3e 100644 --- a/src/Consolonia.Designer/ConsolePreview.cs +++ b/src/Consolonia.Designer/ConsolePreview.cs @@ -2,7 +2,6 @@ using Avalonia; using Avalonia.Controls; -#if DEBUG using Consolonia.PreviewHost; using System; using System.Diagnostics; @@ -15,7 +14,6 @@ using Avalonia.Threading; using Consolonia.Core.Drawing.PixelBufferImplementation; using Newtonsoft.Json; -#endif namespace Consolonia.Designer { @@ -45,7 +43,6 @@ public class ConsolePreview : UserControl public ConsolePreview() { -#if DEBUG _process = null; FontFamily = FontFamily.Parse("Cascadia Mono"); Initialized += (_, _) => LoadXaml(); @@ -54,7 +51,6 @@ public ConsolePreview() { if (e.Property == FileNameProperty) LoadXaml(); }; -#endif } @@ -102,7 +98,6 @@ protected void Dispose(bool disposing) if (disposing) { // TODO: dispose managed state (managed objects) -#if DEBUG #pragma warning disable CA1416 // Validate platform compatibility if (_process != null) { @@ -111,7 +106,6 @@ protected void Dispose(bool disposing) _process = null; } #pragma warning restore CA1416 // Validate platform compatibility -#endif } _disposedValue = true; @@ -125,14 +119,10 @@ public void Dispose() Dispose(true); } -#if DEBUG private Process? _process; private readonly Typeface _typeface = new("Cascadia Mono"); private double _charWidth; private double _charHeight; -#endif - -#if DEBUG private void LoadXaml() { @@ -451,6 +441,5 @@ public void Flush() _textRunCharWidth = 0; } } -#endif } } \ No newline at end of file diff --git a/src/Consolonia.Designer/Consolonia.Designer.csproj b/src/Consolonia.Designer/Consolonia.Designer.csproj index 469b3e80..8a103035 100644 --- a/src/Consolonia.Designer/Consolonia.Designer.csproj +++ b/src/Consolonia.Designer/Consolonia.Designer.csproj @@ -5,16 +5,14 @@ - - + + - - - + diff --git a/src/Consolonia.Designer/Extensions.cs b/src/Consolonia.Designer/Extensions.cs index e6722a4d..12cfb558 100644 --- a/src/Consolonia.Designer/Extensions.cs +++ b/src/Consolonia.Designer/Extensions.cs @@ -19,13 +19,11 @@ public static class Extensions /// public static AppBuilder UseConsoloniaDesigner(this AppBuilder builder) { -#if DEBUG - if (Design.IsDesignMode) //AppDomain.CurrentDomain.FriendlyName == "Avalonia.Designer.HostApp") + if (Design.IsDesignMode) return builder .UsePlatformDetect() .WithInterFont() .LogToTrace(); -#endif return builder.UseConsolonia(); } diff --git a/src/Consolonia.Gallery/Consolonia.Gallery.csproj b/src/Consolonia.Gallery/Consolonia.Gallery.csproj index e3f51ac4..ddd3e7a5 100644 --- a/src/Consolonia.Gallery/Consolonia.Gallery.csproj +++ b/src/Consolonia.Gallery/Consolonia.Gallery.csproj @@ -13,7 +13,6 @@ - diff --git a/src/Consolonia.Gallery/Program.cs b/src/Consolonia.Gallery/Program.cs index eb90f436..a02af67c 100644 --- a/src/Consolonia.Gallery/Program.cs +++ b/src/Consolonia.Gallery/Program.cs @@ -2,7 +2,6 @@ using Avalonia; using Consolonia.Core; using Consolonia.Core.Infrastructure; -using Consolonia.Designer; using Consolonia.PlatformSupport; namespace Consolonia.Gallery @@ -19,11 +18,7 @@ private static void Main(string[] args) public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() -#if DEBUG - .UseConsoloniaDesigner() -#else .UseConsolonia() -#endif .UseAutoDetectedConsole() .LogToException(); } diff --git a/src/Consolonia.NUnit/Consolonia.NUnit.csproj b/src/Consolonia.NUnit/Consolonia.NUnit.csproj index 620824ed..dae1791f 100644 --- a/src/Consolonia.NUnit/Consolonia.NUnit.csproj +++ b/src/Consolonia.NUnit/Consolonia.NUnit.csproj @@ -7,7 +7,6 @@ - diff --git a/src/Consolonia.PlatformSupport/Consolonia.PlatformSupport.csproj b/src/Consolonia.PlatformSupport/Consolonia.PlatformSupport.csproj index 4b1ec17c..e5021693 100644 --- a/src/Consolonia.PlatformSupport/Consolonia.PlatformSupport.csproj +++ b/src/Consolonia.PlatformSupport/Consolonia.PlatformSupport.csproj @@ -1,11 +1,6 @@ - - - - - diff --git a/src/Example.Blazor.Components/Example.Blazor.Components.csproj b/src/Example.Blazor.Components/Example.Blazor.Components.csproj index 20424284..9c058741 100644 --- a/src/Example.Blazor.Components/Example.Blazor.Components.csproj +++ b/src/Example.Blazor.Components/Example.Blazor.Components.csproj @@ -7,10 +7,9 @@ - - - - + + + diff --git a/src/Example.Blazor/Example.Blazor.csproj b/src/Example.Blazor/Example.Blazor.csproj index c47a0b5b..8877968a 100644 --- a/src/Example.Blazor/Example.Blazor.csproj +++ b/src/Example.Blazor/Example.Blazor.csproj @@ -7,12 +7,6 @@ enable - - - - - - diff --git a/src/Tools/Consolonia.PreviewHost/App.axaml.cs b/src/Tools/Consolonia.PreviewHost/App.axaml.cs index 64724bb2..1fa0f380 100644 --- a/src/Tools/Consolonia.PreviewHost/App.axaml.cs +++ b/src/Tools/Consolonia.PreviewHost/App.axaml.cs @@ -37,7 +37,12 @@ public override void OnFrameworkInitializationCompleted() { string folder; if (Path.IsPathFullyQualified(path)) - folder = Path.GetDirectoryName(path)!; + { + if (Directory.Exists(path)) + folder = path; + else + folder = Path.GetDirectoryName(path)!; + } else folder = Environment.CurrentDirectory; ArgumentNullException.ThrowIfNull(folder); diff --git a/src/Tools/Consolonia.PreviewHost/Properties/launchSettings.json b/src/Tools/Consolonia.PreviewHost/Properties/launchSettings.json deleted file mode 100644 index 75d4abbf..00000000 --- a/src/Tools/Consolonia.PreviewHost/Properties/launchSettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "profiles": { - "WSL": { - "commandName": "WSL2", - "distributionName": "" - }, - "Consolonia.PreviewHost": { - "commandName": "Project", - "commandLineArgs": ".", - "workingDirectory": "S:\\github\\Consolonia\\src\\Consolonia.Gallery" - } - } -} \ No newline at end of file