From bba25c16b522c3992eeaf8540807beaab2a05cf3 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Fri, 12 Jul 2024 16:06:54 +0100 Subject: [PATCH 01/30] Target netcore on editor and bootstrapper projects --- Bonsai.Configuration/Bonsai.Configuration.csproj | 3 +++ Bonsai.Configuration/ScriptExtensionsProvider.cs | 4 +--- Bonsai.Design/Bonsai.Design.csproj | 2 +- Bonsai.Editor/Bonsai.Editor.csproj | 4 ++-- Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj | 4 ++-- Bonsai.NuGet.Design/Properties/Resources.Designer.cs | 2 +- Bonsai/Bonsai.csproj | 2 +- Bonsai/Properties/Resources.Designer.cs | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Bonsai.Configuration/Bonsai.Configuration.csproj b/Bonsai.Configuration/Bonsai.Configuration.csproj index 99cb66161..c95ba8551 100644 --- a/Bonsai.Configuration/Bonsai.Configuration.csproj +++ b/Bonsai.Configuration/Bonsai.Configuration.csproj @@ -7,6 +7,9 @@ + + + True diff --git a/Bonsai.Configuration/ScriptExtensionsProvider.cs b/Bonsai.Configuration/ScriptExtensionsProvider.cs index 1be4dab37..00a304089 100644 --- a/Bonsai.Configuration/ScriptExtensionsProvider.cs +++ b/Bonsai.Configuration/ScriptExtensionsProvider.cs @@ -1,5 +1,4 @@ -#if NET472_OR_GREATER -using Microsoft.CSharp; +using Microsoft.CSharp; using NuGet.Common; using NuGet.Configuration; using NuGet.Frameworks; @@ -190,4 +189,3 @@ string GetAssemblyLocation(string fileName) } } } -#endif diff --git a/Bonsai.Design/Bonsai.Design.csproj b/Bonsai.Design/Bonsai.Design.csproj index 88c419edd..3143d6ae0 100644 --- a/Bonsai.Design/Bonsai.Design.csproj +++ b/Bonsai.Design/Bonsai.Design.csproj @@ -3,8 +3,8 @@ Bonsai - Design Library Bonsai Design Library containing base visualizer classes and editor infrastructure. Bonsai Design Rx Reactive Extensions + net472;net6.0-windows true - net472 diff --git a/Bonsai.Editor/Bonsai.Editor.csproj b/Bonsai.Editor/Bonsai.Editor.csproj index d21f28c96..c7e2fe930 100644 --- a/Bonsai.Editor/Bonsai.Editor.csproj +++ b/Bonsai.Editor/Bonsai.Editor.csproj @@ -3,9 +3,9 @@ Bonsai - Editor An integrated development environment for the Bonsai visual programming language. Bonsai Editor Rx Reactive Extensions - true false - net472 + net472;net6.0-windows + true diff --git a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj index 6c16915e2..86d51b910 100644 --- a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj +++ b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj @@ -1,9 +1,9 @@  false - true false - net472 + net472;net6.0-windows + true diff --git a/Bonsai.NuGet.Design/Properties/Resources.Designer.cs b/Bonsai.NuGet.Design/Properties/Resources.Designer.cs index 59253af59..38668de1a 100644 --- a/Bonsai.NuGet.Design/Properties/Resources.Designer.cs +++ b/Bonsai.NuGet.Design/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Bonsai.NuGet.Design.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 66926e891..46fec14c6 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -4,8 +4,8 @@ A visual programming language for data stream processing built on top of Rx for .NET. Bonsai Rx Reactive Extensions false + net48;net6.0-windows true - net48 Exe true ..\Bonsai.Editor\Bonsai.ico diff --git a/Bonsai/Properties/Resources.Designer.cs b/Bonsai/Properties/Resources.Designer.cs index f43b8cfeb..2dbdb7b69 100644 --- a/Bonsai/Properties/Resources.Designer.cs +++ b/Bonsai/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Bonsai.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { From 8f6124f13ed91ff9e2432c86d61249a6743b4d10 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Fri, 12 Jul 2024 16:33:56 +0100 Subject: [PATCH 02/30] Avoid relying on entry assembly for netcore --- Bonsai/Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bonsai/Program.cs b/Bonsai/Program.cs index 8f2737d48..97be4afba 100644 --- a/Bonsai/Program.cs +++ b/Bonsai/Program.cs @@ -220,7 +220,11 @@ internal static int Main(string[] args) editorArgs.AddRange(new[] { PipeCommand, pipeName }); var setupInfo = new ProcessStartInfo(); +#if NETFRAMEWORK setupInfo.FileName = Assembly.GetEntryAssembly().Location; +#else + setupInfo.FileName = Environment.ProcessPath; +#endif setupInfo.Arguments = string.Join(" ", editorArgs); setupInfo.WorkingDirectory = workingDirectory; setupInfo.UseShellExecute = false; From 5bee96f5655de5f5dae5021288578b28acd0b644 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sun, 14 Jul 2024 14:31:22 +0100 Subject: [PATCH 03/30] Add project framework for netcore bootstrapper --- Bonsai/Launcher.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bonsai/Launcher.cs b/Bonsai/Launcher.cs index cdd2a1177..a704c5274 100644 --- a/Bonsai/Launcher.cs +++ b/Bonsai/Launcher.cs @@ -22,7 +22,11 @@ namespace Bonsai { static class Launcher { +#if NETFRAMEWORK internal static readonly NuGetFramework ProjectFramework = NuGetFramework.ParseFolder("net48"); +#else + internal static readonly NuGetFramework ProjectFramework = NuGetFramework.ParseFolder("net6.0-windows7.0"); +#endif internal static int LaunchPackageManager( PackageConfiguration packageConfiguration, From c5807c0a1dee9fec1a059ec8696d48564d1faba4 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 22 Jul 2024 14:17:36 +0100 Subject: [PATCH 04/30] Restrict ScintillaNET update to .NET core app --- Bonsai.Design/Bonsai.Design.csproj | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Bonsai.Design/Bonsai.Design.csproj b/Bonsai.Design/Bonsai.Design.csproj index 3143d6ae0..cfb3fded6 100644 --- a/Bonsai.Design/Bonsai.Design.csproj +++ b/Bonsai.Design/Bonsai.Design.csproj @@ -6,14 +6,18 @@ net472;net6.0-windows true - + + + + + + + + - + - - - \ No newline at end of file From d942d1612e661b9015ef636f39e4d408ed133f91 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 22 Jul 2024 22:55:05 +0100 Subject: [PATCH 05/30] Ensure WindowsDesktop runtime directory is scanned --- Bonsai/LoaderResource.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Bonsai/LoaderResource.cs b/Bonsai/LoaderResource.cs index c91d6947d..fc79ab584 100644 --- a/Bonsai/LoaderResource.cs +++ b/Bonsai/LoaderResource.cs @@ -9,7 +9,13 @@ static class LoaderResource { public static MetadataLoadContext CreateMetadataLoadContext(PackageConfiguration configuration) { - var runtimeAssemblies = Directory.GetFiles(RuntimeEnvironment.GetRuntimeDirectory(), "*.dll"); + var runtimeDirectory = RuntimeEnvironment.GetRuntimeDirectory(); + var runtimeAssemblies = Directory.EnumerateFiles(runtimeDirectory, "*.dll"); +#if NETCOREAPP + var windowsDesktopDirectory = Path.GetDirectoryName(typeof(System.Windows.Forms.Form).Assembly.Location); + var windowsDesktopAssemblies = Directory.EnumerateFiles(windowsDesktopDirectory, "*.dll"); + runtimeAssemblies = System.Linq.Enumerable.Concat(runtimeAssemblies, windowsDesktopAssemblies); +#endif var resolver = new PackageAssemblyResolver(configuration, runtimeAssemblies); return new MetadataLoadContext(resolver); } From 758e5fbeab9ed89db938130c195390ffc9728bf1 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 22 Jul 2024 23:14:42 +0100 Subject: [PATCH 06/30] Avoid using netcore obsolete property --- Bonsai.Editor/AboutBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.Editor/AboutBox.cs b/Bonsai.Editor/AboutBox.cs index a30a103b6..886077861 100644 --- a/Bonsai.Editor/AboutBox.cs +++ b/Bonsai.Editor/AboutBox.cs @@ -52,7 +52,7 @@ public string AssemblyTitle return titleAttribute.Title; } } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); } } From a5d2c3321633a521f69c42731f47fe61280a2b6d Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 22 Jul 2024 23:18:33 +0100 Subject: [PATCH 07/30] Avoid adding .NET framework dependent references --- Bonsai.Editor/Bonsai.Editor.csproj | 7 ++++++- Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Bonsai.Editor/Bonsai.Editor.csproj b/Bonsai.Editor/Bonsai.Editor.csproj index c7e2fe930..0afaa274b 100644 --- a/Bonsai.Editor/Bonsai.Editor.csproj +++ b/Bonsai.Editor/Bonsai.Editor.csproj @@ -7,23 +7,28 @@ net472;net6.0-windows true + + + - + + + True diff --git a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj index 86d51b910..f10f0e9f3 100644 --- a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj +++ b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj @@ -5,13 +5,16 @@ net472;net6.0-windows true + - + + + True From 261d1c059deeef8816b5e2c17687605738a33b89 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 22 Jul 2024 23:19:57 +0100 Subject: [PATCH 08/30] Avoid configuring high DPI mode in App.manifest --- Bonsai/Bonsai.csproj | 4 ++++ Bonsai/EditorBootstrapper.cs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 46fec14c6..874d5daf9 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -9,8 +9,12 @@ Exe true ..\Bonsai.Editor\Bonsai.ico + + + App.manifest + diff --git a/Bonsai/EditorBootstrapper.cs b/Bonsai/EditorBootstrapper.cs index 93e3ebb98..efa049f83 100644 --- a/Bonsai/EditorBootstrapper.cs +++ b/Bonsai/EditorBootstrapper.cs @@ -17,6 +17,9 @@ public static void EnableVisualStyles() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); +#if NETCOREAPP + Application.SetHighDpiMode(HighDpiMode.SystemAware); +#endif visualStylesEnabled = true; } } From b22330d88a5d8a6d31734e6eb1748396284b2d38 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 23 Jul 2024 01:36:12 +0100 Subject: [PATCH 09/30] Remove unused control scaling code for netcore --- Bonsai.Design/PropertyGrid.cs | 4 +++- Bonsai.Editor/EditorForm.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Bonsai.Design/PropertyGrid.cs b/Bonsai.Design/PropertyGrid.cs index 07b8925ea..974fcb4de 100644 --- a/Bonsai.Design/PropertyGrid.cs +++ b/Bonsai.Design/PropertyGrid.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System.Diagnostics; +using System.Drawing; using System.Reflection; using System.Windows.Forms; @@ -16,6 +17,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) base.ScaleControl(factor, specified); } + [Conditional("NETFRAMEWORK")] internal static void ScaleDescriptionPanel(System.Windows.Forms.PropertyGrid propertyGrid, SizeF factor) { foreach (Control control in propertyGrid.Controls) diff --git a/Bonsai.Editor/EditorForm.cs b/Bonsai.Editor/EditorForm.cs index e90ad05f9..d521f4122 100644 --- a/Bonsai.Editor/EditorForm.cs +++ b/Bonsai.Editor/EditorForm.cs @@ -363,6 +363,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) toolboxSplitContainer.SplitterDistance = (int)(toolboxSplitContainer.SplitterDistance * toolboxSplitterScale * factor.Height); workflowSplitContainer.Panel1.Padding = new Padding(0, 6, 0, 2); +#if NETFRAMEWORK var imageSize = toolStrip.ImageScalingSize; var scalingFactor = ((int)(factor.Height * 100) / 50 * 50) / 100f; if (scalingFactor > 1) @@ -373,6 +374,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) statusStrip.ImageScalingSize = toolStrip.ImageScalingSize; propertyGrid.LargeButtons = scalingFactor >= 2; } +#endif base.ScaleControl(factor, specified); } @@ -398,7 +400,7 @@ void editorControl_Disposed(object sender, EventArgs e) iconRenderer.Dispose(); } - #endregion +#endregion #region Toolbox From 118fe0d51fd4c3d220f145a06020e379b33883c9 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 23 Jul 2024 01:50:35 +0100 Subject: [PATCH 10/30] Target post build event to avoid empty target dir --- Bonsai/Bonsai.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 874d5daf9..ccc5681ac 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -57,7 +57,7 @@ - + Date: Tue, 23 Jul 2024 01:58:30 +0100 Subject: [PATCH 11/30] Enable windows targeting for non-windows CI --- tooling/Common.csproj.props | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tooling/Common.csproj.props b/tooling/Common.csproj.props index 6d1aa7a8a..7177608da 100644 --- a/tooling/Common.csproj.props +++ b/tooling/Common.csproj.props @@ -31,6 +31,9 @@ true + + true + none From fd979cee901c574ede9c7be95fd05c54adecd9f9 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 23 Jul 2024 02:37:39 +0100 Subject: [PATCH 12/30] Repack bootstrapper only for net48 target --- .github/workflows/Bonsai.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Bonsai.yml b/.github/workflows/Bonsai.yml index 7ae6a4f1b..08b80cf95 100644 --- a/.github/workflows/Bonsai.yml +++ b/.github/workflows/Bonsai.yml @@ -113,7 +113,7 @@ jobs: # This happens before pack since the bootstrapper package uses it - name: Repack bootstrapper if: matrix.create-installer || env.UseRepackForBootstrapperPackage == 'true' - run: dotnet build Bonsai --no-restore --configuration ${{matrix.configuration}} -t:Repack + run: dotnet build Bonsai --no-restore --configuration ${{matrix.configuration}} -t:Repack -p:TargetFramework=net48 # ----------------------------------------------------------------------- Pack # Since packages are core to Bonsai functionality we always pack them even if they won't be collected From 92620919dc858d6e0169c91891eaa2eb4de80bd6 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 23 Jul 2024 03:16:45 +0100 Subject: [PATCH 13/30] Ensure argument name for argument null exceptions --- .../Expressions/ExpressionBuilderGraphExtensions.cs | 2 +- Bonsai.Design/MemberSelectorEditorController.cs | 2 +- Bonsai.Design/TypeVisitor.cs | 2 +- Bonsai.Editor/GraphView/SvgRenderer.cs | 4 ++-- Bonsai.NuGet.Design/LicenseAcceptanceDialog.cs | 2 +- Bonsai.NuGet.Design/PackageBuilderDialog.cs | 9 ++------- Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs | 2 +- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Bonsai.Core/Expressions/ExpressionBuilderGraphExtensions.cs b/Bonsai.Core/Expressions/ExpressionBuilderGraphExtensions.cs index dd6257ce1..672dfee67 100644 --- a/Bonsai.Core/Expressions/ExpressionBuilderGraphExtensions.cs +++ b/Bonsai.Core/Expressions/ExpressionBuilderGraphExtensions.cs @@ -1106,7 +1106,7 @@ static ExpressionBuilder UnwrapConvert(ExpressionBuilder builder, Func EnsureNode(nodes, member.Name, memberType)); diff --git a/Bonsai.Design/TypeVisitor.cs b/Bonsai.Design/TypeVisitor.cs index ac5eb4d37..b943ec78a 100644 --- a/Bonsai.Design/TypeVisitor.cs +++ b/Bonsai.Design/TypeVisitor.cs @@ -23,7 +23,7 @@ internal static void VisitMember(this Type type, Action visito { if (type == null) { - throw new ArgumentNullException("componentType"); + throw new ArgumentNullException(nameof(type)); } foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public) diff --git a/Bonsai.Editor/GraphView/SvgRenderer.cs b/Bonsai.Editor/GraphView/SvgRenderer.cs index 7f066566b..15b680141 100644 --- a/Bonsai.Editor/GraphView/SvgRenderer.cs +++ b/Bonsai.Editor/GraphView/SvgRenderer.cs @@ -616,7 +616,7 @@ public SvgRenderer GetIconRenderer(GraphNode node) { if (node == null) { - throw new ArgumentNullException("node"); + throw new ArgumentNullException(nameof(node)); } var icon = node.Icon; @@ -661,7 +661,7 @@ bool TryGetIconRenderer(ElementIcon icon, out SvgRenderer renderer) { if (icon == null) { - throw new ArgumentNullException("icon"); + throw new ArgumentNullException(nameof(icon)); } if (!rendererCache.TryGetValue(icon.Name, out renderer)) diff --git a/Bonsai.NuGet.Design/LicenseAcceptanceDialog.cs b/Bonsai.NuGet.Design/LicenseAcceptanceDialog.cs index 93ce161a9..214cac6d1 100644 --- a/Bonsai.NuGet.Design/LicenseAcceptanceDialog.cs +++ b/Bonsai.NuGet.Design/LicenseAcceptanceDialog.cs @@ -15,7 +15,7 @@ public LicenseAcceptanceDialog(IEnumerable licensePackag { if (licensePackages == null) { - throw new ArgumentNullException("licensePackages"); + throw new ArgumentNullException(nameof(licensePackages)); } InitializeComponent(); diff --git a/Bonsai.NuGet.Design/PackageBuilderDialog.cs b/Bonsai.NuGet.Design/PackageBuilderDialog.cs index e77f7b327..8c0a74a9d 100644 --- a/Bonsai.NuGet.Design/PackageBuilderDialog.cs +++ b/Bonsai.NuGet.Design/PackageBuilderDialog.cs @@ -520,14 +520,9 @@ class ConstantPropertyDescriptor : PropertyDescriptor readonly object constant; public ConstantPropertyDescriptor(string name, object value) - : base(name, new Attribute[0]) + : base(name, Array.Empty()) { - if (value == null) - { - throw new ArgumentNullException("value"); - } - - constant = value; + constant = value ?? throw new ArgumentNullException(nameof(value)); } public override bool CanResetValue(object component) diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs index 0109c942a..01851cb74 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs @@ -16,7 +16,7 @@ public PackageSourceConfigurationDialog(IPackageSourceProvider sourceProvider) { if (sourceProvider == null) { - throw new ArgumentNullException("sourceProvider"); + throw new ArgumentNullException(nameof(sourceProvider)); } InitializeComponent(); From 7d5391ab6fc555ec1c1da8c83c596370958a3467 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 23 Jul 2024 09:18:44 +0100 Subject: [PATCH 14/30] Remove netcore bootstrapper target from CI builds --- Bonsai/Bonsai.csproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index ccc5681ac..729a80375 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -4,7 +4,8 @@ A visual programming language for data stream processing built on top of Rx for .NET. Bonsai Rx Reactive Extensions false - net48;net6.0-windows + net48;net6.0-windows + net48 true Exe true @@ -110,14 +111,14 @@ - + - + From 585d0ea86ef520272f80a1a8fa349699e8ead4a7 Mon Sep 17 00:00:00 2001 From: David Maas Date: Wed, 31 Jul 2024 01:45:44 -0500 Subject: [PATCH 15/30] Add multi-targeting support to Bonsai.csproj --- Bonsai/Bonsai.csproj | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 729a80375..9fc7793e8 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -4,18 +4,20 @@ A visual programming language for data stream processing built on top of Rx for .NET. Bonsai Rx Reactive Extensions false - net48;net6.0-windows - net48 + net48;net6.0-windows true Exe true ..\Bonsai.Editor\Bonsai.ico + + + $(Configuration.ToLowerInvariant()) App.manifest - + @@ -80,6 +82,7 @@ + @@ -110,14 +113,14 @@ - + - + From b75360085b77f91d69ee0f11a8241ef266dd0aac Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 11:41:15 +0100 Subject: [PATCH 16/30] Target net8.0 for core and design assemblies --- Bonsai.Core/Bonsai.Core.csproj | 4 ++-- Bonsai.Design/Bonsai.Design.csproj | 2 +- Bonsai.Editor/Bonsai.Editor.csproj | 2 +- Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj | 2 +- Bonsai.Player/Bonsai.Player.csproj | 2 +- Bonsai/Bonsai.csproj | 2 +- Bonsai/Launcher.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Bonsai.Core/Bonsai.Core.csproj b/Bonsai.Core/Bonsai.Core.csproj index 5dc070c26..36abf48c4 100644 --- a/Bonsai.Core/Bonsai.Core.csproj +++ b/Bonsai.Core/Bonsai.Core.csproj @@ -3,14 +3,14 @@ Bonsai - Core Library Bonsai Core Library containing base classes and workflow infrastructure. Bonsai Rx Reactive Extensions - net472;netstandard2.0;net6.0 + net472;netstandard2.0;net8.0 Bonsai - + diff --git a/Bonsai.Design/Bonsai.Design.csproj b/Bonsai.Design/Bonsai.Design.csproj index cfb3fded6..09b11b2bb 100644 --- a/Bonsai.Design/Bonsai.Design.csproj +++ b/Bonsai.Design/Bonsai.Design.csproj @@ -3,7 +3,7 @@ Bonsai - Design Library Bonsai Design Library containing base visualizer classes and editor infrastructure. Bonsai Design Rx Reactive Extensions - net472;net6.0-windows + net472;net8.0-windows true diff --git a/Bonsai.Editor/Bonsai.Editor.csproj b/Bonsai.Editor/Bonsai.Editor.csproj index 0afaa274b..7cfead4df 100644 --- a/Bonsai.Editor/Bonsai.Editor.csproj +++ b/Bonsai.Editor/Bonsai.Editor.csproj @@ -4,7 +4,7 @@ An integrated development environment for the Bonsai visual programming language. Bonsai Editor Rx Reactive Extensions false - net472;net6.0-windows + net472;net8.0-windows true diff --git a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj index f10f0e9f3..e38da51b9 100644 --- a/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj +++ b/Bonsai.NuGet.Design/Bonsai.NuGet.Design.csproj @@ -2,7 +2,7 @@ false false - net472;net6.0-windows + net472;net8.0-windows true diff --git a/Bonsai.Player/Bonsai.Player.csproj b/Bonsai.Player/Bonsai.Player.csproj index 7ce2e0d48..e9393f4d0 100644 --- a/Bonsai.Player/Bonsai.Player.csproj +++ b/Bonsai.Player/Bonsai.Player.csproj @@ -3,7 +3,7 @@ Exe Bonsai - Player bonsai - net6.0 + net8.0 A tool for running Bonsai workflows from the command-line. Bonsai Player Rx Reactive Extensions false diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 9fc7793e8..d289fd3c8 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -4,7 +4,7 @@ A visual programming language for data stream processing built on top of Rx for .NET. Bonsai Rx Reactive Extensions false - net48;net6.0-windows + net48;net8.0-windows true Exe true diff --git a/Bonsai/Launcher.cs b/Bonsai/Launcher.cs index a704c5274..7de4c378e 100644 --- a/Bonsai/Launcher.cs +++ b/Bonsai/Launcher.cs @@ -25,7 +25,7 @@ static class Launcher #if NETFRAMEWORK internal static readonly NuGetFramework ProjectFramework = NuGetFramework.ParseFolder("net48"); #else - internal static readonly NuGetFramework ProjectFramework = NuGetFramework.ParseFolder("net6.0-windows7.0"); + internal static readonly NuGetFramework ProjectFramework = NuGetFramework.ParseFolder("net8.0-windows7.0"); #endif internal static int LaunchPackageManager( From 7b69ef5ed7a226b081937419f7277d35a6ec7e2e Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 11:47:39 +0100 Subject: [PATCH 17/30] Remove all uses of legacy serialization APIs --- Bonsai.Core/WorkflowBuildException.cs | 3 + Bonsai.Core/WorkflowException.cs | 3 + Bonsai.Core/WorkflowRuntimeException.cs | 3 + Bonsai.Editor/StartScreen.cs | 4 +- ...ckageSourceConfigurationDialog.Designer.cs | 8 +-- .../PackageSourceConfigurationDialog.cs | 12 ++++ .../PackageSourceConfigurationDialog.resx | 71 ++++++------------- 7 files changed, 48 insertions(+), 56 deletions(-) diff --git a/Bonsai.Core/WorkflowBuildException.cs b/Bonsai.Core/WorkflowBuildException.cs index 40c0d8478..ecb9fcf69 100644 --- a/Bonsai.Core/WorkflowBuildException.cs +++ b/Bonsai.Core/WorkflowBuildException.cs @@ -88,6 +88,9 @@ public WorkflowBuildException(string message, ExpressionBuilder builder, Excepti /// The that contains contextual information about /// the source or destination. /// +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] +#endif protected WorkflowBuildException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/Bonsai.Core/WorkflowException.cs b/Bonsai.Core/WorkflowException.cs index 7d274d015..f83f6e20f 100644 --- a/Bonsai.Core/WorkflowException.cs +++ b/Bonsai.Core/WorkflowException.cs @@ -90,6 +90,9 @@ public WorkflowException(string message, ExpressionBuilder builder, Exception in /// The that contains contextual information about /// the source or destination. /// +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] +#endif protected WorkflowException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/Bonsai.Core/WorkflowRuntimeException.cs b/Bonsai.Core/WorkflowRuntimeException.cs index a2ffc18b1..3d755a6d1 100644 --- a/Bonsai.Core/WorkflowRuntimeException.cs +++ b/Bonsai.Core/WorkflowRuntimeException.cs @@ -88,6 +88,9 @@ public WorkflowRuntimeException(string message, ExpressionBuilder builder, Excep /// The that contains contextual information about /// the source or destination. /// +#if NET8_0_OR_GREATER + [Obsolete(DiagnosticId = "SYSLIB0051")] +#endif protected WorkflowRuntimeException(SerializationInfo info, StreamingContext context) : base(info, context) { diff --git a/Bonsai.Editor/StartScreen.cs b/Bonsai.Editor/StartScreen.cs index 07cbefc38..33ab20eaf 100644 --- a/Bonsai.Editor/StartScreen.cs +++ b/Bonsai.Editor/StartScreen.cs @@ -125,8 +125,8 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) var newFileImage = (Image)resources.GetObject("newToolStripMenuItem.Image"); var openFileImage = (Image)resources.GetObject("openFileToolStripMenuItem.Image"); var openFolderImage = (Image)resources.GetObject("openToolStripMenuItem.Image"); - var galleryItemImage = (Image)(resources.GetObject("galleryToolStripMenuItem.Image")); - var packageManagerItemImage = (Image)(resources.GetObject("packageManagerToolStripMenuItem.Image")); + var galleryItemImage = (Image)resources.GetObject("galleryToolStripMenuItem.Image"); + var packageManagerItemImage = (Image)resources.GetObject("packageManagerToolStripMenuItem.Image"); var editorTheme = EditorSettings.Instance.EditorTheme; if (editorTheme == ColorTheme.Dark) { diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs index aa8d73488..a8bd258a4 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs @@ -29,7 +29,6 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageSourceConfigurationDialog)); this.moveDownButton = new System.Windows.Forms.Button(); this.moveUpButton = new System.Windows.Forms.Button(); this.removeButton = new System.Windows.Forms.Button(); @@ -207,10 +206,9 @@ private void InitializeComponent() // // checkBoxesImageList // - this.checkBoxesImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("checkBoxesImageList.ImageStream"))); + this.checkBoxesImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; + this.checkBoxesImageList.ImageSize = new System.Drawing.Size(16, 16); this.checkBoxesImageList.TransparentColor = System.Drawing.Color.Transparent; - this.checkBoxesImageList.Images.SetKeyName(0, "unchecked"); - this.checkBoxesImageList.Images.SetKeyName(1, "checked"); // // machineWideListLabel // @@ -308,4 +306,4 @@ private void InitializeComponent() private System.Windows.Forms.ColumnHeader machineWideNameHeader; private System.Windows.Forms.ColumnHeader machineWideSourceHeader; } -} \ No newline at end of file +} diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs index 01851cb74..46a5af6a9 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs @@ -1,5 +1,7 @@ using NuGet.Configuration; using System; +using System.ComponentModel; +using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -10,6 +12,7 @@ public partial class PackageSourceConfigurationDialog : Form const string NuGetSourceName = "nuget.org"; const string DefaultPackageSourceName = "Package source"; const string DefaultPackageSource = "http://packagesource"; + readonly ComponentResourceManager resources = new(typeof(PackageSourceConfigurationDialog)); readonly IPackageSourceProvider provider; public PackageSourceConfigurationDialog(IPackageSourceProvider sourceProvider) @@ -23,6 +26,15 @@ public PackageSourceConfigurationDialog(IPackageSourceProvider sourceProvider) provider = sourceProvider; } + protected override void ScaleControl(SizeF factor, BoundsSpecified specified) + { + var uncheckedImage = (Image)resources.GetObject("unchecked.Image"); + var checkedImage = (Image)resources.GetObject("checked.Image"); + checkBoxesImageList.Images.Add("unchecked", uncheckedImage); + checkBoxesImageList.Images.Add("checked", checkedImage); + base.ScaleControl(factor, specified); + } + static PackageSource GetItemPackageSource(ListViewItem item) { if (item.Tag == null) diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx index 8bcad8443..6c6e620dd 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAAKFJREFUOE+lkUEKwzAMBPM2P87f6C99dbPCKrOKS1K6IGI5O0NpjjnnX+MLMsaY + vgAADr4B6kKxwAAAAKFJREFUOE+lkUEKwzAMBPM2P87f6C99dbPCKrOKS1K6IGI5O0NpjjnnX+MLMsaY nHUdMcYWRFBrLeax4Cy+VuerQB0yVaBySHYCvdOZzE4QEj0pyDsNmYug955AFXzekbkIBGSRAt3lmcxW kJLd+VbAcp38ZWSqIP6onSRhdciYgJ+KEsLqGGPLCiUVVoyxBUlJhRVjbClZEoMVY7j8PvN4A80ziomU 990nAAAAAElFTkSuQmCC @@ -130,7 +130,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vwAADr8BOAVTJAAAAJlJREFUOE+lktENgCAMRJmN4VjDLfmttmnJXalR4yWXUOQ9E6WJyK/ykDLnPLQ+ + vgAADr4B6kKxwAAAAJlJREFUOE+lktENgCAMRJmN4VjDLfmttmnJXalR4yWXUOQ9E6WJyK/ykDLnPLQ+ rhBDA8Rh8ZKEGBo8AY8xrFlCDA1XEO69W7OEGBwquJIgkwUl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R42xtxvFkBKqa8KRFbH + GdEpgHXxJxl6ri5NAQTEWtuRcXVpCUjeewbG1aVPAHobRp+BWa/A7pEYOOkQILoAJ5VmTOFnoT4AAAAA + SUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wgAADsIBFShKgAAAAC1JREFUOE9j+E8hABtQXl5OMoYBuAGkgFEDRg0AgUFqAKkYBsAGUAIoNOD/fwB6 + Pq+umpazgQAAAABJRU5ErkJggg== - - 17, 17 - \ No newline at end of file From 7e1891bf9d78f25a26dc78716815993fcffcb6c5 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 23:10:47 +0100 Subject: [PATCH 18/30] Use TargetFrameworkIdentifier for item conditions --- Bonsai.Configuration/Bonsai.Configuration.csproj | 2 +- Bonsai.Core/Bonsai.Core.csproj | 6 +++--- Bonsai.NuGet/Bonsai.NuGet.csproj | 4 ++-- Bonsai.System/Bonsai.System.csproj | 2 +- Bonsai/Bonsai.csproj | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Bonsai.Configuration/Bonsai.Configuration.csproj b/Bonsai.Configuration/Bonsai.Configuration.csproj index c95ba8551..7417f17a2 100644 --- a/Bonsai.Configuration/Bonsai.Configuration.csproj +++ b/Bonsai.Configuration/Bonsai.Configuration.csproj @@ -7,7 +7,7 @@ - + diff --git a/Bonsai.Core/Bonsai.Core.csproj b/Bonsai.Core/Bonsai.Core.csproj index 36abf48c4..2b82e59c9 100644 --- a/Bonsai.Core/Bonsai.Core.csproj +++ b/Bonsai.Core/Bonsai.Core.csproj @@ -6,15 +6,15 @@ net472;netstandard2.0;net8.0 Bonsai - + - + - + diff --git a/Bonsai.NuGet/Bonsai.NuGet.csproj b/Bonsai.NuGet/Bonsai.NuGet.csproj index 357f00f46..b525d2837 100644 --- a/Bonsai.NuGet/Bonsai.NuGet.csproj +++ b/Bonsai.NuGet/Bonsai.NuGet.csproj @@ -4,10 +4,10 @@ false net472;netstandard2.0 - + - + diff --git a/Bonsai.System/Bonsai.System.csproj b/Bonsai.System/Bonsai.System.csproj index 3572e4d7f..0de4fc5cb 100644 --- a/Bonsai.System/Bonsai.System.csproj +++ b/Bonsai.System/Bonsai.System.csproj @@ -5,7 +5,7 @@ Bonsai Rx Reactive Extensions IO Serial Port Resources net472;netstandard2.0 - + diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index d289fd3c8..4c544d7af 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -14,6 +14,7 @@ $(Configuration.ToLowerInvariant()) + App.manifest From c3a0a769ab75a3da8f51cc7bc71e862c397ba8a9 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 23:12:37 +0100 Subject: [PATCH 19/30] Target net8.0 for configuration and nuget projects --- Bonsai.Configuration/Bonsai.Configuration.csproj | 2 +- Bonsai.NuGet/Bonsai.NuGet.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bonsai.Configuration/Bonsai.Configuration.csproj b/Bonsai.Configuration/Bonsai.Configuration.csproj index 7417f17a2..e93b6e483 100644 --- a/Bonsai.Configuration/Bonsai.Configuration.csproj +++ b/Bonsai.Configuration/Bonsai.Configuration.csproj @@ -2,7 +2,7 @@ false false - net472;netstandard2.0 + net472;net8.0 diff --git a/Bonsai.NuGet/Bonsai.NuGet.csproj b/Bonsai.NuGet/Bonsai.NuGet.csproj index b525d2837..11871248b 100644 --- a/Bonsai.NuGet/Bonsai.NuGet.csproj +++ b/Bonsai.NuGet/Bonsai.NuGet.csproj @@ -2,7 +2,7 @@ false false - net472;netstandard2.0 + net472;net8.0 From 4af1f33847533d41a7550d0adcd19a77cb406b83 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 23:12:49 +0100 Subject: [PATCH 20/30] Avoid using obsolete CodeBase property The loader has a special case for URI scheme locations where it loads assemblies using Assembly.Load from bytes instead of using Assembly.LoadFrom which we preserved for now. --- Bonsai.Configuration/ScriptExtensionsProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bonsai.Configuration/ScriptExtensionsProvider.cs b/Bonsai.Configuration/ScriptExtensionsProvider.cs index 00a304089..30ccad5f8 100644 --- a/Bonsai.Configuration/ScriptExtensionsProvider.cs +++ b/Bonsai.Configuration/ScriptExtensionsProvider.cs @@ -180,8 +180,9 @@ string GetAssemblyLocation(string fileName) else { var assemblyName = AssemblyName.GetAssemblyName(assemblyFile); + var assemblyUri = new Uri(assemblyFile).AbsoluteUri; configuration.AssemblyReferences.Add(assemblyName.Name); - configuration.AssemblyLocations.Add(assemblyName.Name, ProcessorArchitecture.MSIL, assemblyName.CodeBase); + configuration.AssemblyLocations.Add(assemblyName.Name, ProcessorArchitecture.MSIL, assemblyUri); scriptEnvironment.AssemblyName = assemblyName; } return scriptEnvironment; From 31c0f174ed6f1710a590963034858dbf5262090e Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 31 Jul 2024 23:13:22 +0100 Subject: [PATCH 21/30] Update package dependencies --- Bonsai.Configuration/Bonsai.Configuration.csproj | 2 +- Bonsai.Core.Tests/Bonsai.Core.Tests.csproj | 8 ++++---- Bonsai.Core/Bonsai.Core.csproj | 4 ++-- Bonsai.Editor.Tests/Bonsai.Editor.Tests.csproj | 10 +++++----- Bonsai.Editor/Bonsai.Editor.csproj | 8 ++++---- Bonsai.NuGet/Bonsai.NuGet.csproj | 2 +- Bonsai.System.Tests/Bonsai.System.Tests.csproj | 8 ++++---- Bonsai.System/Bonsai.System.csproj | 2 +- Bonsai/Bonsai.csproj | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Bonsai.Configuration/Bonsai.Configuration.csproj b/Bonsai.Configuration/Bonsai.Configuration.csproj index e93b6e483..519289b82 100644 --- a/Bonsai.Configuration/Bonsai.Configuration.csproj +++ b/Bonsai.Configuration/Bonsai.Configuration.csproj @@ -8,7 +8,7 @@ - + diff --git a/Bonsai.Core.Tests/Bonsai.Core.Tests.csproj b/Bonsai.Core.Tests/Bonsai.Core.Tests.csproj index 7108861ef..97b1258a9 100644 --- a/Bonsai.Core.Tests/Bonsai.Core.Tests.csproj +++ b/Bonsai.Core.Tests/Bonsai.Core.Tests.csproj @@ -8,10 +8,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Bonsai.Core/Bonsai.Core.csproj b/Bonsai.Core/Bonsai.Core.csproj index 2b82e59c9..20acb7430 100644 --- a/Bonsai.Core/Bonsai.Core.csproj +++ b/Bonsai.Core/Bonsai.Core.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Bonsai.Editor.Tests/Bonsai.Editor.Tests.csproj b/Bonsai.Editor.Tests/Bonsai.Editor.Tests.csproj index 1f6d31481..a35485721 100644 --- a/Bonsai.Editor.Tests/Bonsai.Editor.Tests.csproj +++ b/Bonsai.Editor.Tests/Bonsai.Editor.Tests.csproj @@ -1,4 +1,4 @@ - + false false @@ -8,10 +8,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Bonsai.Editor/Bonsai.Editor.csproj b/Bonsai.Editor/Bonsai.Editor.csproj index 7cfead4df..7a154255a 100644 --- a/Bonsai.Editor/Bonsai.Editor.csproj +++ b/Bonsai.Editor/Bonsai.Editor.csproj @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/Bonsai.NuGet/Bonsai.NuGet.csproj b/Bonsai.NuGet/Bonsai.NuGet.csproj index 11871248b..7ab9e607b 100644 --- a/Bonsai.NuGet/Bonsai.NuGet.csproj +++ b/Bonsai.NuGet/Bonsai.NuGet.csproj @@ -8,7 +8,7 @@ - + diff --git a/Bonsai.System.Tests/Bonsai.System.Tests.csproj b/Bonsai.System.Tests/Bonsai.System.Tests.csproj index 5bb95f1e0..d95d1a1ea 100644 --- a/Bonsai.System.Tests/Bonsai.System.Tests.csproj +++ b/Bonsai.System.Tests/Bonsai.System.Tests.csproj @@ -5,10 +5,10 @@ net472 - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Bonsai.System/Bonsai.System.csproj b/Bonsai.System/Bonsai.System.csproj index 0de4fc5cb..7048a4fe2 100644 --- a/Bonsai.System/Bonsai.System.csproj +++ b/Bonsai.System/Bonsai.System.csproj @@ -6,7 +6,7 @@ net472;netstandard2.0 - + diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index 4c544d7af..f47eca764 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers From a0a6009a29d07b86ea251e465699b07a1c65c4db Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 00:59:22 +0100 Subject: [PATCH 22/30] Assume MSIL architecture when scanning extensions --- Bonsai.Configuration/ConfigurationHelper.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Bonsai.Configuration/ConfigurationHelper.cs b/Bonsai.Configuration/ConfigurationHelper.cs index 01b722b60..96ba02d97 100644 --- a/Bonsai.Configuration/ConfigurationHelper.cs +++ b/Bonsai.Configuration/ConfigurationHelper.cs @@ -207,11 +207,18 @@ public static void RegisterPath(this PackageConfiguration configuration, string catch (BadImageFormatException) { continue; } catch (IOException) { continue; } - var locationKey = (assemblyName.Name, assemblyName.ProcessorArchitecture); +#if NET7_0_OR_GREATER + // Support for ProcessorArchitecture was removed in NET7 so assume MSIL for now + var processorArchitecture = ProcessorArchitecture.MSIL; +#else + var processorArchitecture = assemblyName.ProcessorArchitecture; +#endif + + var locationKey = (assemblyName.Name, processorArchitecture); if (!configuration.AssemblyLocations.Contains(locationKey)) { configuration.AssemblyReferences.Add(assemblyName.Name); - configuration.AssemblyLocations.Add(assemblyName.Name, assemblyName.ProcessorArchitecture, assemblyFile); + configuration.AssemblyLocations.Add(assemblyName.Name, processorArchitecture, assemblyFile); } } } From 6d79f45bd47f756ff442e7aa3abe711d36e3640f Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 02:32:14 +0100 Subject: [PATCH 23/30] Avoid using AssemblyName processor architecture --- .../PackageConfigurationUpdater.cs | 79 +++++++++++++------ 1 file changed, 55 insertions(+), 24 deletions(-) diff --git a/Bonsai.Configuration/PackageConfigurationUpdater.cs b/Bonsai.Configuration/PackageConfigurationUpdater.cs index db667a214..db7fb95c3 100644 --- a/Bonsai.Configuration/PackageConfigurationUpdater.cs +++ b/Bonsai.Configuration/PackageConfigurationUpdater.cs @@ -98,7 +98,7 @@ static bool IsTaggedPackage(PackageReaderBase package) return tags != null && tags.Contains(PackageTagFilter); } - static string ResolvePlatformNameAlias(string name) + static ProcessorArchitecture ResolveArchitectureAlias(string name) { switch (name) { @@ -108,20 +108,20 @@ static string ResolvePlatformNameAlias(string name) case "intel64": case "x86-64": case "x86_64": - return "x64"; + return ProcessorArchitecture.Amd64; case "win32": case "x86": case "ia32": case "386": - return "x86"; + return ProcessorArchitecture.X86; default: - return string.Empty; + return ProcessorArchitecture.None; } } - static string ResolvePathPlatformName(string path) + static ProcessorArchitecture ResolvePathArchitecture(string path) { - var platformName = string.Empty; + var architecture = ProcessorArchitecture.None; var components = path.Split(DirectorySeparators, StringSplitOptions.RemoveEmptyEntries); components = Array.ConvertAll(components, name => name.ToLower()); @@ -130,23 +130,24 @@ static string ResolvePathPlatformName(string path) { for (int i = 3; i < components.Length; i++) { - platformName = ResolvePlatformNameAlias(components[i]); - if (!string.IsNullOrEmpty(platformName)) break; + architecture = ResolveArchitectureAlias(components[i]); + if (architecture != ProcessorArchitecture.None) break; } } - return platformName; + return architecture; } - static IEnumerable GetAssemblyLocations(NuGetFramework projectFramework, PackageReaderBase package) + static IEnumerable> GetArchitectureSpecificAssemblyLocations(NuGetFramework projectFramework, PackageReaderBase package) { var nearestFramework = package.GetItems(PackagingConstants.Folders.Build).GetNearest(projectFramework); - if (nearestFramework == null) return Enumerable.Empty(); + if (nearestFramework == null) return Enumerable.Empty>(); return from file in nearestFramework.Items - where Path.GetExtension(file) == AssemblyExtension && - !string.IsNullOrEmpty(ResolvePathPlatformName(file)) - select PathUtility.GetPathWithForwardSlashes(file); + where Path.GetExtension(file) == AssemblyExtension + let architecture = ResolvePathArchitecture(file) + where architecture != ProcessorArchitecture.None + group PathUtility.GetPathWithForwardSlashes(file) by architecture; } static IEnumerable GetLibraryFolders(PackageReaderBase package, string installPath) @@ -164,9 +165,11 @@ static IEnumerable GetBuildLibraryFolders(PackageReaderBase packa return from file in nativeFramework.Items group file by Path.GetDirectoryName(file) into folder - let platform = ResolvePathPlatformName(folder.Key) - where !string.IsNullOrWhiteSpace(platform) - select new LibraryFolder(CombinePath(installPath, folder.Key), platform); + let architecture = ResolvePathArchitecture(folder.Key) + where architecture != ProcessorArchitecture.None + select new LibraryFolder( + CombinePath(installPath, folder.Key), + architecture == ProcessorArchitecture.X86 ? "x86" : "x64"); } static IEnumerable GetRuntimeLibraryFolders(PackageReaderBase package, string installPath) @@ -189,21 +192,39 @@ static IEnumerable GetCompatibleAssemblyReferences(NuGetFramework projec void RegisterAssemblyLocations(PackageReaderBase package, string installPath, string relativePath, bool addReferences) { - var assemblyLocations = GetAssemblyLocations(bootstrapperFramework, package); - RegisterAssemblyLocations(assemblyLocations, installPath, relativePath, addReferences); + var platformSpecificLocations = GetArchitectureSpecificAssemblyLocations(bootstrapperFramework, package); + foreach (var assemblyLocations in platformSpecificLocations) + { + RegisterAssemblyLocations(assemblyLocations, installPath, relativePath, addReferences, assemblyLocations.Key); + } } - void RegisterAssemblyLocations(IEnumerable assemblyLocations, string installPath, string relativePath, bool addReferences) + void RegisterAssemblyLocations( + IEnumerable assemblyLocations, + string installPath, + string relativePath, + bool addReferences, + ProcessorArchitecture processorArchitecture = ProcessorArchitecture.None) { foreach (var path in assemblyLocations) { var assemblyFile = CombinePath(installPath, path); var assemblyName = AssemblyName.GetAssemblyName(assemblyFile); + if (processorArchitecture == ProcessorArchitecture.None) + { +#if NET7_0_OR_GREATER + // Support for ProcessorArchitecture was removed in NET7 so assume MSIL for now + processorArchitecture = ProcessorArchitecture.MSIL; +#else + processorArchitecture = assemblyName.ProcessorArchitecture; +#endif + } + var assemblyLocation = CombinePath(relativePath, path); - var assemblyLocationKey = (assemblyName.Name, assemblyName.ProcessorArchitecture); + var assemblyLocationKey = (assemblyName.Name, processorArchitecture); if (!packageConfiguration.AssemblyLocations.Contains(assemblyLocationKey)) { - packageConfiguration.AssemblyLocations.Add(assemblyName.Name, assemblyName.ProcessorArchitecture, assemblyLocation); + packageConfiguration.AssemblyLocations.Add(assemblyName.Name, processorArchitecture, assemblyLocation); } else if (packageConfiguration.AssemblyLocations[assemblyLocationKey].Location != assemblyLocation) { @@ -219,8 +240,11 @@ void RegisterAssemblyLocations(IEnumerable assemblyLocations, string ins void RemoveAssemblyLocations(PackageReaderBase package, string installPath, bool removeReference) { - var assemblyLocations = GetAssemblyLocations(bootstrapperFramework, package); - RemoveAssemblyLocations(assemblyLocations, installPath, removeReference); + var platformSpecificLocations = GetArchitectureSpecificAssemblyLocations(bootstrapperFramework, package); + foreach (var assemblyLocations in platformSpecificLocations) + { + RemoveAssemblyLocations(assemblyLocations, installPath, removeReference); + } } void RemoveAssemblyLocations(IEnumerable assemblyLocations, string installPath, bool removeReference) @@ -462,6 +486,13 @@ public override Task OnPackageInstalledAsync(PackageIdentity package, NuGetFrame } } + // Reference assemblies should generally always be MSIL but for backwards compatibility + // we allow the processor architecture to be set by the assembly for .NET Framework. + // In future releases of the modern .NET bootstrapper we need to revisit this entirely + // and ensure that none of these considerations impact on the Bonsai.config file, + // most likely by removing all platform-specific paths and references. Runtime assembly + // resolution is OS-specific and architecture-specific and should not be versioned together + // with the package dependency graph. var assemblyLocations = GetCompatibleAssemblyReferences(projectFramework, packageReader); Owner.RegisterAssemblyLocations(assemblyLocations, installPath, relativePath, taggedPackage); packageConfiguration.Save(); From fe3f5fbc754641e1064748cc0904bbc1a1def1dd Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 02:39:00 +0100 Subject: [PATCH 24/30] Remove unused control scaling code for net8.0 --- Bonsai.Editor/EditorForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.Editor/EditorForm.cs b/Bonsai.Editor/EditorForm.cs index d521f4122..cbd55f480 100644 --- a/Bonsai.Editor/EditorForm.cs +++ b/Bonsai.Editor/EditorForm.cs @@ -353,6 +353,7 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) scaleFactor = factor; inverseScaleFactor = new SizeF(1f / factor.Width, 1f / factor.Height); +#if NETFRAMEWORK const float DefaultToolboxSplitterDistance = 245f; var workflowSplitterScale = EditorSettings.IsRunningOnMono ? 0.5f / factor.Width : 1.0f; var toolboxSplitterScale = EditorSettings.IsRunningOnMono ? 0.75f / factor.Height : 1.0f; @@ -363,7 +364,6 @@ protected override void ScaleControl(SizeF factor, BoundsSpecified specified) toolboxSplitContainer.SplitterDistance = (int)(toolboxSplitContainer.SplitterDistance * toolboxSplitterScale * factor.Height); workflowSplitContainer.Panel1.Padding = new Padding(0, 6, 0, 2); -#if NETFRAMEWORK var imageSize = toolStrip.ImageScalingSize; var scalingFactor = ((int)(factor.Height * 100) / 50 * 50) / 100f; if (scalingFactor > 1) From 52e24d8334ca233397d652e57adf8fbc5016acf7 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 02:47:08 +0100 Subject: [PATCH 25/30] Fix indentation --- Bonsai.Editor/EditorForm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.Editor/EditorForm.cs b/Bonsai.Editor/EditorForm.cs index cbd55f480..48f0799af 100644 --- a/Bonsai.Editor/EditorForm.cs +++ b/Bonsai.Editor/EditorForm.cs @@ -400,7 +400,7 @@ void editorControl_Disposed(object sender, EventArgs e) iconRenderer.Dispose(); } -#endregion + #endregion #region Toolbox From d107c540e5fe99321c1ed89569b1cf6272c7394c Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 02:49:37 +0100 Subject: [PATCH 26/30] Change TargetDir to OutputPath --- Bonsai/Bonsai.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bonsai/Bonsai.csproj b/Bonsai/Bonsai.csproj index f47eca764..ee1cc53b8 100644 --- a/Bonsai/Bonsai.csproj +++ b/Bonsai/Bonsai.csproj @@ -61,8 +61,8 @@ - - + From d0da51d0550f3c59b4f65b7108040cb56e6c7bc6 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 10:38:45 +0100 Subject: [PATCH 27/30] Bump minor version --- tooling/CurrentVersion.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/CurrentVersion.props b/tooling/CurrentVersion.props index aa48087d5..6193f263e 100644 --- a/tooling/CurrentVersion.props +++ b/tooling/CurrentVersion.props @@ -1,6 +1,6 @@ - 2.8.6 + 2.9.0 \ No newline at end of file From 35618529499c770f89a3d63b85f9df3b4f8c68d2 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Thu, 1 Aug 2024 23:58:52 +0100 Subject: [PATCH 28/30] Drop serialization constructors from net8.0 target --- Bonsai.Core/WorkflowBuildException.cs | 5 ++--- Bonsai.Core/WorkflowException.cs | 5 ++--- Bonsai.Core/WorkflowRuntimeException.cs | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Bonsai.Core/WorkflowBuildException.cs b/Bonsai.Core/WorkflowBuildException.cs index ecb9fcf69..f62dd69ff 100644 --- a/Bonsai.Core/WorkflowBuildException.cs +++ b/Bonsai.Core/WorkflowBuildException.cs @@ -76,6 +76,7 @@ public WorkflowBuildException(string message, ExpressionBuilder builder, Excepti { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with /// serialized data. @@ -88,12 +89,10 @@ public WorkflowBuildException(string message, ExpressionBuilder builder, Excepti /// The that contains contextual information about /// the source or destination. /// -#if NET8_0_OR_GREATER - [Obsolete(DiagnosticId = "SYSLIB0051")] -#endif protected WorkflowBuildException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/Bonsai.Core/WorkflowException.cs b/Bonsai.Core/WorkflowException.cs index f83f6e20f..44fe61214 100644 --- a/Bonsai.Core/WorkflowException.cs +++ b/Bonsai.Core/WorkflowException.cs @@ -78,6 +78,7 @@ public WorkflowException(string message, ExpressionBuilder builder, Exception in Builder = builder; } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with /// serialized data. @@ -90,13 +91,11 @@ public WorkflowException(string message, ExpressionBuilder builder, Exception in /// The that contains contextual information about /// the source or destination. /// -#if NET8_0_OR_GREATER - [Obsolete(DiagnosticId = "SYSLIB0051")] -#endif protected WorkflowException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif /// /// Gets the instance that was the cause for the exception. diff --git a/Bonsai.Core/WorkflowRuntimeException.cs b/Bonsai.Core/WorkflowRuntimeException.cs index 3d755a6d1..947ad0265 100644 --- a/Bonsai.Core/WorkflowRuntimeException.cs +++ b/Bonsai.Core/WorkflowRuntimeException.cs @@ -76,6 +76,7 @@ public WorkflowRuntimeException(string message, ExpressionBuilder builder, Excep { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with /// serialized data. @@ -88,12 +89,10 @@ public WorkflowRuntimeException(string message, ExpressionBuilder builder, Excep /// The that contains contextual information about /// the source or destination. /// -#if NET8_0_OR_GREATER - [Obsolete(DiagnosticId = "SYSLIB0051")] -#endif protected WorkflowRuntimeException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } From a2b58c6cdb24e98495115d433d75b3dba4521abc Mon Sep 17 00:00:00 2001 From: glopesdev Date: Fri, 2 Aug 2024 09:46:10 +0100 Subject: [PATCH 29/30] Move checkbox images to Resources.resx This is to avoid sharing resource manager state with the designer or having two duplicate resource manager instances. --- ...ckageSourceConfigurationDialog.Designer.cs | 1 + .../PackageSourceConfigurationDialog.cs | 9 ++---- .../PackageSourceConfigurationDialog.resx | 32 +++++-------------- .../Properties/Resources.Designer.cs | 20 ++++++++++++ Bonsai.NuGet.Design/Properties/Resources.resx | 32 ++++++++++++++----- 5 files changed, 56 insertions(+), 38 deletions(-) diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs index a8bd258a4..507758848 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.Designer.cs @@ -29,6 +29,7 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageSourceConfigurationDialog)); this.moveDownButton = new System.Windows.Forms.Button(); this.moveUpButton = new System.Windows.Forms.Button(); this.removeButton = new System.Windows.Forms.Button(); diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs index 46a5af6a9..998c2babe 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.cs @@ -1,6 +1,5 @@ using NuGet.Configuration; using System; -using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -12,7 +11,6 @@ public partial class PackageSourceConfigurationDialog : Form const string NuGetSourceName = "nuget.org"; const string DefaultPackageSourceName = "Package source"; const string DefaultPackageSource = "http://packagesource"; - readonly ComponentResourceManager resources = new(typeof(PackageSourceConfigurationDialog)); readonly IPackageSourceProvider provider; public PackageSourceConfigurationDialog(IPackageSourceProvider sourceProvider) @@ -28,10 +26,9 @@ public PackageSourceConfigurationDialog(IPackageSourceProvider sourceProvider) protected override void ScaleControl(SizeF factor, BoundsSpecified specified) { - var uncheckedImage = (Image)resources.GetObject("unchecked.Image"); - var checkedImage = (Image)resources.GetObject("checked.Image"); - checkBoxesImageList.Images.Add("unchecked", uncheckedImage); - checkBoxesImageList.Images.Add("checked", checkedImage); + checkBoxesImageList.Images.Clear(); + checkBoxesImageList.Images.Add("unchecked", Properties.Resources.UncheckedImage); + checkBoxesImageList.Images.Add("checked", Properties.Resources.CheckedImage); base.ScaleControl(factor, specified); } diff --git a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx index 6c6e620dd..acf64cb99 100644 --- a/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx +++ b/Bonsai.NuGet.Design/PackageSourceConfigurationDialog.resx @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vgAADr4B6kKxwAAAAKFJREFUOE+lkUEKwzAMBPM2P87f6C99dbPCKrOKS1K6IGI5O0NpjjnnX+MLMsaY + vQAADr0BR/uQrQAAAKFJREFUOE+lkUEKwzAMBPM2P87f6C99dbPCKrOKS1K6IGI5O0NpjjnnX+MLMsaY nHUdMcYWRFBrLeax4Cy+VuerQB0yVaBySHYCvdOZzE4QEj0pyDsNmYug955AFXzekbkIBGSRAt3lmcxW kJLd+VbAcp38ZWSqIP6onSRhdciYgJ+KEsLqGGPLCiUVVoyxBUlJhRVjbClZEoMVY7j8PvN4A80ziomU 990nAAAAAElFTkSuQmCC @@ -130,7 +130,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vgAADr4B6kKxwAAAAJlJREFUOE+lktENgCAMRJmN4VjDLfmttmnJXalR4yWXUOQ9E6WJyK/ykDLnPLQ+ + vQAADr0BR/uQrQAAAJlJREFUOE+lktENgCAMRJmN4VjDLfmttmnJXalR4yWXUOQ9E6WJyK/ykDLnPLQ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AABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAJpJREFUOE+lzgEJwCAQhWFT2MEIhjCDMWxgB2uYwwoWsMSNd+xExpQ5fxDm2H07 - RYcxEELYPlIHdvoFxBip1srP20DOmZRSpLXm+xbQWuNBANgCLQF8VEq5b0TOOR42xtxvFkBKqa8KRFbH - GdEpgHXxJxl6ri5NAQTEWtuRcXVpCUjeewbG1aVPAHobRp+BWa/A7pEYOOkQILoAJ5VmTOFnoT4AAAAA - SUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAAC1JREFUOE9j+E8hABtQXl5OMoYBuAGkgFEDRg0AgUFqAKkYBsAGUAIoNOD/fwB6 - Pq+umpazgQAAAABJRU5ErkJggg== - - + \ No newline at end of file diff --git a/Bonsai.NuGet.Design/Properties/Resources.Designer.cs b/Bonsai.NuGet.Design/Properties/Resources.Designer.cs index 38668de1a..cdca4e43e 100644 --- a/Bonsai.NuGet.Design/Properties/Resources.Designer.cs +++ b/Bonsai.NuGet.Design/Properties/Resources.Designer.cs @@ -69,6 +69,16 @@ internal static string AllNodeName { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap CheckedImage { + get { + object obj = ResourceManager.GetObject("CheckedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to No existing package metadata file exists. Do you want to create a new file?. /// @@ -406,6 +416,16 @@ internal static System.Drawing.Bitmap SettingsImage { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap UncheckedImage { + get { + object obj = ResourceManager.GetObject("UncheckedImage", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized string similar to Uninstalling.... /// diff --git a/Bonsai.NuGet.Design/Properties/Resources.resx b/Bonsai.NuGet.Design/Properties/Resources.resx index a785397d2..da2bf1d0a 100644 --- a/Bonsai.NuGet.Design/Properties/Resources.resx +++ b/Bonsai.NuGet.Design/Properties/Resources.resx @@ -173,7 +173,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wgAADsIBFShKgAAAANdJREFUOE+dU7kNwzAM1CjZwQtpBA/gwqVX8CKpAggI4FojuHNrwIVahZeQhh7a + wQAADsEBuJFr7QAAANdJREFUOE+dU7kNwzAM1CjZwQtpBA/gwqVX8CKpAggI4FojuHNrwIVahZeQhh7a cXLAFSJ5Rz2UKRFCsERHjAURs1xWg5I3op/mKbb3NjZjkxEx5FCDWpZ9wOK1e3SVsOTwHGCyZia08Eho Ao1s4kVssTWtUNi7PgLLtuwxPo6FgdPOnBJCAEYSgwZaGGTFJbXuQmi/GmjdhapBKjjrDqoGqeisOygG 1SWKEDjqnl5i9YyyC+Co+/6MPAv+yhQKs0ECaPEe5SvTqI4ywCb/faYUlPzhOxvzAkO1WA01cJaNAAAA @@ -198,7 +198,7 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wQAADsEBuJFr7QAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTFH80I3AAABzElEQVRYR82X + wAAADsABataJCQAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTFH80I3AAABzElEQVRYR82X y23DMAyGM0JH6QhF7hkgm6RZwsgMzQa5uyPk3Pba9uoWyOOo6gtElZEpy3aBuAQ+IBHJn4xedmbOuUkx B2/J74eCHQ6H+9PpVHn2HmfAeEVcSMnaoAbO5/PD8Xh8Top1Qjx5QaJlvRvwYvxis0hPqiB1ZcUGmqa5 88mtqd7tdm69Xrv5fN6CcfxpjmePXpC+WLEBkrRIXdduuVyahVOII17ne/ZB+mKdDfjgq2nfbDZmoRLk @@ -275,15 +275,31 @@ - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAADYSURBVDhPpVOxEYMwDGQUZqGnd0nhsegZI00oXDkjeAOS - htbRK3qfQ4ocWHd/Z0n/byzs7hj7vk+CmyAfgNpktN+QZi+IRs4ppTwMgwJr1o3Tm+wTKAi2ZVlyCEGJ - WNNgnmetoYc6uNCYXA1iLfDe53EcS441aszNJFKMM6s7Cf/Ar4QWBmVg3AU7rvc1P7eXAmt+ETjkQwsD - HRLOSRLFMT4UNKE5uBysGqBRg2LmNKk5wGkD59wXrxi0HqF5iG2/0e7C9YuEkKTtKiNQEFx7THVI88Rz - 7ro3JJCBt2M2zxYAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAANhJREFUOE+lU7ERgzAMZBRmoad3SeGx6BkjTShcOSN4A5KG1tErep9DihxYd39n + Sf9vLOzuGPu+T4KbIB+A2mS035BmL4hGzimlPAyDAmvWjdOb7BMoCLZlWXIIQYlY02CeZ62hhzq40Jhc + DWIt8N7ncRxLjjVqzM0kUowzqzsJ/8CvhBYGZWDcBTuu9zU/t5cCa34ROORDCwMdEs5JEsUxPhQ0oTm4 + HKwaoFGDYuY0qTnAaQPn3BevGLQeoXmIbb/R7sL1i4SQpO0qI1AQXHtMdUjzxHPuujckkIG3YzbPFgAA + AABJRU5ErkJggg== The package '{0}' is not a gallery package. Please install this package through the package manager dialog. + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAAJpJREFUOE+lzgEJwCAQhWFT2MEIhjCDMWxgB2uYwwoWsMSNd+xExpQ5fxDm2H07 + RYcxEELYPlIHdvoFxBip1srP20DOmZRSpLXm+xbQWuNBANgCLQF8VEq5b0TOOR42xtxvFkBKqa8KRFbH + GdEpgHXxJxl6ri5NAQTEWtuRcXVpCUjeewbG1aVPAHobRp+BWa/A7pEYOOkQILoAJ5VmTOFnoT4AAAAA + SUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wQAADsEBuJFr7QAAAC1JREFUOE9j+E8hABtQXl5OMoYBuAGkgFEDRg0AgUFqAKkYBsAGUAIoNOD/fwB6 + Pq+umpazgQAAAABJRU5ErkJggg== + + \ No newline at end of file From cfa4e62350b2fe47815d12e794959e7a7a961d07 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Fri, 2 Aug 2024 10:00:42 +0100 Subject: [PATCH 30/30] Reduce label margin to avoid control clipping --- Bonsai.NuGet.Design/PackageManagerDialog.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.NuGet.Design/PackageManagerDialog.Designer.cs b/Bonsai.NuGet.Design/PackageManagerDialog.Designer.cs index c5f75219e..c51cf8a4f 100644 --- a/Bonsai.NuGet.Design/PackageManagerDialog.Designer.cs +++ b/Bonsai.NuGet.Design/PackageManagerDialog.Designer.cs @@ -241,7 +241,7 @@ private void InitializeComponent() // packageSourceLabel // this.packageSourceLabel.Location = new System.Drawing.Point(4, 0); - this.packageSourceLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.packageSourceLabel.Margin = new System.Windows.Forms.Padding(4, 0, 0, 0); this.packageSourceLabel.Name = "packageSourceLabel"; this.packageSourceLabel.Size = new System.Drawing.Size(120, 27); this.packageSourceLabel.TabIndex = 3;