From e2bed0ab72620693e68f3c7476ed79461ce08e6a Mon Sep 17 00:00:00 2001 From: Stephen Shaw Date: Fri, 30 Apr 2021 11:44:30 -0600 Subject: Re-enable OneLocBuild The required tasks aren't public yet, so this can't be merged until then --- azure-pipelines.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index a14e617..0a713e9 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -25,6 +25,6 @@ stages: - template: .build/automation/stages/validate.yml - template: .build/automation/stages/security_compliance.yml # The following Stages are dependent on the OneLocBuild task which is not available in the Xamarin Public AzDevops instance -# - template: .build/automation/stages/localization-handoff.yml # Process outgoing strings [Localization Handoff] -# - template: .build/automation/stages/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] -# - template: .build/automation/stages/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] + - template: .build/automation/stages/localization-handoff.yml # Process outgoing strings [Localization Handoff] + - template: .build/automation/stages/localization-handback.yml # Process incoming translations and Create PR to main [Localization Handback] + - template: .build/automation/stages/merge-translations-update.yml # Validating incoming translations strings and merge PR [Localization Handback] -- cgit v1.2.3 From 79a9fe38fb0f135e7d2433e93b04e957279aad23 Mon Sep 17 00:00:00 2001 From: "Michael Cummings (MSFT)" Date: Thu, 21 Oct 2021 08:33:44 -0400 Subject: Update pool for merge-translations-update.yml --- .build/automation/stages/merge-translations-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/automation/stages/merge-translations-update.yml b/.build/automation/stages/merge-translations-update.yml index e70f091..ebcae9b 100644 --- a/.build/automation/stages/merge-translations-update.yml +++ b/.build/automation/stages/merge-translations-update.yml @@ -8,7 +8,7 @@ stages: - job : validate_merge displayName: 'Validate and Merge Translations' pool: - name: VSEng-ReleasePool + name: $(HostedWinVS2019) variables: pull_request_number: $(System.PullRequest.PullRequestNumber) workspace: -- cgit v1.2.3 From bbf2a4b5a2ba0711ceb82c32e941112025d41a79 Mon Sep 17 00:00:00 2001 From: "Michael Cummings (MSFT)" Date: Thu, 21 Oct 2021 09:52:53 -0400 Subject: Correct Pathing --- .config/LocProject.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/LocProject.json b/.config/LocProject.json index 90f9cbe..128e94d 100644 --- a/.config/LocProject.json +++ b/.config/LocProject.json @@ -4,10 +4,10 @@ "LanguageSet": "VS_Main_Languages", "LocItems": [ { - "SourceFile": "Xamarin.PropertyEditing\\Resources\\Resources.resx", - "LclFile": "loc\\{Lang}\\Xamarin.PropertyEditing\\Resources\\Resources.resx.lcl", + "SourceFile": "Xamarin.PropertyEditing\\Properties\\Resources.resx", + "LclFile": "loc\\{Lang}\\Xamarin.PropertyEditing\\Properties\\Resources.resx.lcl", "CopyOption": "LangIDOnName", - "OutputPath": "\\Xamarin.PropertyEditing\\Resources\\Resources" + "OutputPath": "\\Xamarin.PropertyEditing\\Properties" } ], "LssFiles": [], -- cgit v1.2.3 From 18c20c93984360943844907cfc27fbf96597fd2c Mon Sep 17 00:00:00 2001 From: "Michael Cummings (MSFT)" Date: Thu, 21 Oct 2021 10:03:37 -0400 Subject: Update Path for relative --- .config/LocProject.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/LocProject.json b/.config/LocProject.json index 128e94d..d534e7b 100644 --- a/.config/LocProject.json +++ b/.config/LocProject.json @@ -7,7 +7,7 @@ "SourceFile": "Xamarin.PropertyEditing\\Properties\\Resources.resx", "LclFile": "loc\\{Lang}\\Xamarin.PropertyEditing\\Properties\\Resources.resx.lcl", "CopyOption": "LangIDOnName", - "OutputPath": "\\Xamarin.PropertyEditing\\Properties" + "OutputPath": "Xamarin.PropertyEditing\\Properties" } ], "LssFiles": [], -- cgit v1.2.3 From 506abb107b1e2b63313711ccf954ea8ec6fe5d04 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Thu, 6 Jan 2022 18:41:06 -0500 Subject: Switch Mac project to .net6 --- Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj index eee6cb9..13acdb4 100644 --- a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj +++ b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj @@ -1,7 +1,7 @@ - net472 + net6.0 10.12 -- cgit v1.2.3 From e919e936e01e619ae21a33990f5b3a1becf64ffb Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 10:13:07 -0500 Subject: Add provisioning support for .net6 for mac --- bot-provisioning/dependencies.csx | 9 +++++++++ global.json | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 global.json diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index b082be1..82fe02c 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -2,6 +2,15 @@ using static Xamarin.Provisioning.ProvisioningScript; +if (IsMac) { + DotNetCoreSdk ("../global.json") + .Workload( + "microsoft.net.sdk.macos", + "12.0.101-preview.10.249", + "https://aka.ms/dotnet6/nuget/index.json", + "https://api.nuget.org/v3/index.json"); +} + Item ("https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2020-02/77/e9d3af508e46454389cb29836d19616eae1615c0/MonoFramework-MDK-6.12.0.74.macos10.xamarin.universal.pkg"); Item ("https://download.visualstudio.microsoft.com/download/pr/951ce94d-144e-4a6e-9c1b-31066ce2044c/6c24acc6dfa374bb5f311c46e0dddc03/xamarin.mac-7.11.2.4.pkg"); Xcode ("12.4.0").XcodeSelect(); diff --git a/global.json b/global.json new file mode 100644 index 0000000..ea38bea --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "6.0.100", + "rollForward": "latestFeature" + } +} -- cgit v1.2.3 From aa8bc4641c18821269ef10117f05e71f7b7110be Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 14:58:01 -0500 Subject: Fixup Mac and Tests project build options --- Directory.Build.props | 6 ++++- .../Xamarin.PropertyEditing.Mac.csproj | 14 ++---------- .../Xamarin.PropertyEditing.Tests.csproj | 26 +++++++++------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index dfcb57f..138326c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,3 +1,7 @@ - + + $([MSBuild]::IsOSPlatform('OSX')) + $([MSBuild]::IsOSPlatform('Windows')) + $([MSBuild]::IsOSPlatform('Linux')) + diff --git a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj index 13acdb4..42c433b 100644 --- a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj +++ b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj @@ -1,20 +1,10 @@ - net6.0 - 10.12 + net6.0-macos + 10.14 - - - - - - /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/x86_64/full/Xamarin.Mac.dll - /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/64bits/full/Xamarin.Mac.dll - - - diff --git a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj index ef2a41d..78474b4 100644 --- a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj +++ b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj @@ -1,28 +1,22 @@  - + + net6.0 + + net472 - $(MSBuildThisFileDirectory)packages\ - - - - - - - - - - - + + $(MSBuildThisFileDirectory)packages\ + - - - + + + -- cgit v1.2.3 From 346cbe818d613f63bf13437af36e91b7c053ca3d Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 14:58:47 -0500 Subject: Fix Mac.Standalone project to build with .net6 --- Xamarin.PropertyEditing.Mac.Standalone/Info.plist | 5 +- .../MockedAppKitControlButton.cs | 43 ------- .../MockedAppKitControlButton.designer.cs | 9 -- .../Xamarin.PropertyEditing.Mac.Standalone.csproj | 129 ++------------------- 4 files changed, 9 insertions(+), 177 deletions(-) delete mode 100644 Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.cs delete mode 100644 Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.designer.cs diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Info.plist b/Xamarin.PropertyEditing.Mac.Standalone/Info.plist index a9d6ddb..3f7108c 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Info.plist +++ b/Xamarin.PropertyEditing.Mac.Standalone/Info.plist @@ -1,4 +1,4 @@ - + @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.11 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion @@ -28,6 +28,5 @@ Main XSAppIconAssets Assets.xcassets/AppIcon.appiconset - diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.cs deleted file mode 100644 index ad2e4d0..0000000 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using Foundation; -using AppKit; -using Xamarin.PropertyEditing.Tests.MockControls; - -namespace Xamarin.PropertyEditing.Mac.Standalone -{ - public abstract class MockedAppKitControlButton : AppKit.NSButtonCell where T : MockControl - { - protected MockedAppKitControlButton (T mockedControl, IntPtr handle) : base (handle) - { - MockedControl = mockedControl; - Initialize (); - } - - protected MockedAppKitControlButton (T mockedControl, NSCoder coder) : base (coder) - { - Initialize (); - MockedControl = mockedControl; - } - - // Shared initialization code - void Initialize () - { - } - - public T MockedControl { get; } - } - - public partial class MockedAppKitButton : MockedAppKitControlButton - { - // Called when created from unmanaged code - public MockedAppKitButton (IntPtr handle) : base (new MockNSButton (), handle) - { - } - - // Called when created directly from a XIB file - [Export ("initWithCoder:")] - public MockedAppKitButton (NSCoder coder) : base (new MockNSButton (), coder) - { - } - } -} diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.designer.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.designer.cs deleted file mode 100644 index c81fc16..0000000 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitControlButton.designer.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Xamarin.PropertyEditing.Mac.Standalone -{ - - // Should subclass AppKit.NSView - [Foundation.Register ("MockedAppKitButton")] - public partial class MockedAppKitButton - { - } -} diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj index a92df9b..6ea6b0a 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj +++ b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj @@ -1,134 +1,19 @@ - + - Debug - AnyCPU - {8319A66C-72AE-4C40-B737-97279D4AB899} - {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + net6.0-macos Exe - Xamarin.PropertyEditing.Mac.Standalone - Xamarin.PropertyEditing.Mac.Standalone - Resources - v4.7.2 - - 10.12 + 10.14 - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - Mac Developer - false - false - false - true - true - false - - - - True - - - pdbonly - true - bin\Release - - prompt - 4 - false - true - false - true - true - true - None - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ViewController.cs - - - - - - - - - - - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485} - Xamarin.PropertyEditing.Mac - - - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A} - Xamarin.PropertyEditing - - - {84101D04-9CE4-4CE7-916E-21F86EE96898} - Xamarin.PropertyEditing.Tests - + + + - - + \ No newline at end of file -- cgit v1.2.3 From 78a304ac7314100fca3cedb236f1c3746a1ead96 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:13:13 -0500 Subject: Remove unneeded mac dependencies --- bot-provisioning/dependencies.csx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index 82fe02c..477e5bc 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -9,8 +9,7 @@ if (IsMac) { "12.0.101-preview.10.249", "https://aka.ms/dotnet6/nuget/index.json", "https://api.nuget.org/v3/index.json"); + + Xcode ("13.2.1").XcodeSelect (); } -Item ("https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2020-02/77/e9d3af508e46454389cb29836d19616eae1615c0/MonoFramework-MDK-6.12.0.74.macos10.xamarin.universal.pkg"); -Item ("https://download.visualstudio.microsoft.com/download/pr/951ce94d-144e-4a6e-9c1b-31066ce2044c/6c24acc6dfa374bb5f311c46e0dddc03/xamarin.mac-7.11.2.4.pkg"); -Xcode ("12.4.0").XcodeSelect(); -- cgit v1.2.3 From 1043a0283ed70feae6bf214d6da0051eefcc0b42 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:26:47 -0500 Subject: Update msbuildVersion to 16.0 --- .build/automation/stages/validate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 590824b..87f9203 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -16,14 +16,14 @@ stages: displayName: Build inputs: solution: build.proj - msbuildVersion: "15.0" + msbuildVersion: "16.0" msbuildArguments: '/restore /p:Release=true /t:Build' - task: MSBuild@1 displayName: 'Run Tests' inputs: solution: build.proj - msbuildVersion: "15.0" + msbuildVersion: "16.0" msbuildArguments: '/p:Release=true /t:Test' - task: PublishTestResults@2 @@ -61,14 +61,14 @@ stages: displayName: Build inputs: solution: build.proj - msbuildVersion: "15.0" + msbuildVersion: "16.0" msbuildArguments: '/restore /p:Release=true /t:Build' - task: MSBuild@1 displayName: 'Run Tests' inputs: solution: build.proj - msbuildVersion: "15.0" + msbuildVersion: "16.0" msbuildArguments: '/p:Release=true /t:Test' - task: PublishTestResults@2 -- cgit v1.2.3 From 9b238f6b4de0d1629afe55fbab0894fdb8e4a428 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:32:53 -0500 Subject: Undo - switch back to msbuild 15.0 --- .build/automation/stages/validate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 87f9203..590824b 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -16,14 +16,14 @@ stages: displayName: Build inputs: solution: build.proj - msbuildVersion: "16.0" + msbuildVersion: "15.0" msbuildArguments: '/restore /p:Release=true /t:Build' - task: MSBuild@1 displayName: 'Run Tests' inputs: solution: build.proj - msbuildVersion: "16.0" + msbuildVersion: "15.0" msbuildArguments: '/p:Release=true /t:Test' - task: PublishTestResults@2 @@ -61,14 +61,14 @@ stages: displayName: Build inputs: solution: build.proj - msbuildVersion: "16.0" + msbuildVersion: "15.0" msbuildArguments: '/restore /p:Release=true /t:Build' - task: MSBuild@1 displayName: 'Run Tests' inputs: solution: build.proj - msbuildVersion: "16.0" + msbuildVersion: "15.0" msbuildArguments: '/p:Release=true /t:Test' - task: PublishTestResults@2 -- cgit v1.2.3 From ae7eedd416a286c475b12216fb8f595f477e4043 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:44:57 -0500 Subject: Update solution --- Xamarin.PropertyEditing.sln | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Xamarin.PropertyEditing.sln b/Xamarin.PropertyEditing.sln index 9404a75..297c815 100644 --- a/Xamarin.PropertyEditing.sln +++ b/Xamarin.PropertyEditing.sln @@ -7,14 +7,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows", "Xamarin.PropertyEditing.Windows\Xamarin.PropertyEditing.Windows.csproj", "{60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Tests", "Xamarin.PropertyEditing.Tests\Xamarin.PropertyEditing.Tests.csproj", "{84101D04-9CE4-4CE7-916E-21F86EE96898}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows.Standalone", "Xamarin.PropertyEditing.Windows.Standalone\Xamarin.PropertyEditing.Windows.Standalone.csproj", "{070E46F6-916C-4987-8F90-C0CEF1572FFE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac.Standalone", "Xamarin.PropertyEditing.Mac.Standalone\Xamarin.PropertyEditing.Mac.Standalone.csproj", "{8319A66C-72AE-4C40-B737-97279D4AB899}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac", "Xamarin.PropertyEditing.Mac\Xamarin.PropertyEditing.Mac.csproj", "{E8F4F0EB-C2B1-4116-8459-E076E0E0E485}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Tests", "Xamarin.PropertyEditing.Tests\Xamarin.PropertyEditing.Tests.csproj", "{BA78BFE9-B51A-476D-B949-BD764CB55807}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac.Standalone", "Xamarin.PropertyEditing.Mac.Standalone\Xamarin.PropertyEditing.Mac.Standalone.csproj", "{A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -37,32 +37,32 @@ Global {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Release|Any CPU.Build.0 = Release|Any CPU {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.Release|Any CPU.Build.0 = Release|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {84101D04-9CE4-4CE7-916E-21F86EE96898}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.Build.0 = Release|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU {070E46F6-916C-4987-8F90-C0CEF1572FFE}.ReleaseMac|Any CPU.ActiveCfg = Debug|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {8319A66C-72AE-4C40-B737-97279D4AB899}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.Build.0 = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.Build.0 = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE -- cgit v1.2.3 From 442004572a3bfcb12a86862398d671ecc4374b27 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:47:44 -0500 Subject: Also provision on Windows --- .build/automation/stages/validate.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 590824b..e3116d3 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -12,6 +12,19 @@ stages: clean: true persistCredentials: true + - task: CmdLine@1 + displayName: 'Set Token' + inputs: + filename: echo + arguments: '##vso[task.setvariable variable=GITHUB_TOKEN]$(GitHub.Token)' + + - task: provisionator@2 + displayName: Provision Dependencies + inputs: + github_token: $(GitHub.Token) + provisioning_script: $(System.DefaultWorkingDirectory)/bot-provisioning/dependencies.csx + provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token) + - task: MSBuild@1 displayName: Build inputs: -- cgit v1.2.3 From 34de26ec34365bbdae1e30a289cc990aca18acd1 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 15:50:49 -0500 Subject: Provision .net6 on Windows too --- bot-provisioning/dependencies.csx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index 477e5bc..f759e51 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -12,4 +12,6 @@ if (IsMac) { Xcode ("13.2.1").XcodeSelect (); } - +else if (IsWindows) { + DotNetCoreSdk ("../global.json"); +} -- cgit v1.2.3 From 8ea1d27c701e201c931b92990614adfb81777f97 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 16:17:10 -0500 Subject: Use Mac specific solution --- Xamarin.PropertyEditing-Mac.sln | 90 ++++++++++++++++++++++ .../Xamarin.PropertyEditing.Mac.Standalone.csproj | 2 + build.proj | 5 +- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 Xamarin.PropertyEditing-Mac.sln diff --git a/Xamarin.PropertyEditing-Mac.sln b/Xamarin.PropertyEditing-Mac.sln new file mode 100644 index 0000000..297c815 --- /dev/null +++ b/Xamarin.PropertyEditing-Mac.sln @@ -0,0 +1,90 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.25920.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing", "Xamarin.PropertyEditing\Xamarin.PropertyEditing.csproj", "{A0B6FE73-D046-4E1C-BA9D-F20683889C5A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows", "Xamarin.PropertyEditing.Windows\Xamarin.PropertyEditing.Windows.csproj", "{60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows.Standalone", "Xamarin.PropertyEditing.Windows.Standalone\Xamarin.PropertyEditing.Windows.Standalone.csproj", "{070E46F6-916C-4987-8F90-C0CEF1572FFE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac", "Xamarin.PropertyEditing.Mac\Xamarin.PropertyEditing.Mac.csproj", "{E8F4F0EB-C2B1-4116-8459-E076E0E0E485}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Tests", "Xamarin.PropertyEditing.Tests\Xamarin.PropertyEditing.Tests.csproj", "{BA78BFE9-B51A-476D-B949-BD764CB55807}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac.Standalone", "Xamarin.PropertyEditing.Mac.Standalone\Xamarin.PropertyEditing.Mac.Standalone.csproj", "{A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + DebugMac|Any CPU = DebugMac|Any CPU + ReleaseMac|Any CPU = ReleaseMac|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Release|Any CPU.Build.0 = Release|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Release|Any CPU.Build.0 = Release|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.Build.0 = Release|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {070E46F6-916C-4987-8F90-C0CEF1572FFE}.ReleaseMac|Any CPU.ActiveCfg = Debug|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.Build.0 = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = PrefixedHierarchical + $0.TextStylePolicy = $2 + $2.FileWidth = 80 + $2.scope = text/x-csharp + $0.CSharpFormattingPolicy = $3 + $3.NewLinesForBracesInAnonymousMethods = False + $3.NewLinesForBracesInControlBlocks = False + $3.NewLinesForBracesInAnonymousTypes = False + $3.NewLinesForBracesInObjectCollectionArrayInitializers = False + $3.NewLinesForBracesInLambdaExpressionBody = False + $3.NewLineForElse = False + $3.NewLineForCatch = False + $3.NewLineForFinally = False + $3.SpacingAfterMethodDeclarationName = True + $3.SpaceAfterMethodCallName = True + $3.scope = text/x-csharp + EndGlobalSection +EndGlobal diff --git a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj index 6ea6b0a..b8f1d55 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj +++ b/Xamarin.PropertyEditing.Mac.Standalone/Xamarin.PropertyEditing.Mac.Standalone.csproj @@ -5,11 +5,13 @@ Exe 10.14 + + diff --git a/build.proj b/build.proj index 9fa0342..07233c8 100644 --- a/build.proj +++ b/build.proj @@ -38,7 +38,10 @@ - + + + + -- cgit v1.2.3 From be5b1be0c7f7950a74a3f7658c3510416359aa50 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 18:21:06 -0500 Subject: Remove Windows from mac only solution --- Xamarin.PropertyEditing-Mac.sln | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Xamarin.PropertyEditing-Mac.sln b/Xamarin.PropertyEditing-Mac.sln index 297c815..24b909e 100644 --- a/Xamarin.PropertyEditing-Mac.sln +++ b/Xamarin.PropertyEditing-Mac.sln @@ -5,10 +5,6 @@ VisualStudioVersion = 15.0.25920.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing", "Xamarin.PropertyEditing\Xamarin.PropertyEditing.csproj", "{A0B6FE73-D046-4E1C-BA9D-F20683889C5A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows", "Xamarin.PropertyEditing.Windows\Xamarin.PropertyEditing.Windows.csproj", "{60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Windows.Standalone", "Xamarin.PropertyEditing.Windows.Standalone\Xamarin.PropertyEditing.Windows.Standalone.csproj", "{070E46F6-916C-4987-8F90-C0CEF1572FFE}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac", "Xamarin.PropertyEditing.Mac\Xamarin.PropertyEditing.Mac.csproj", "{E8F4F0EB-C2B1-4116-8459-E076E0E0E485}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Tests", "Xamarin.PropertyEditing.Tests\Xamarin.PropertyEditing.Tests.csproj", "{BA78BFE9-B51A-476D-B949-BD764CB55807}" @@ -31,18 +27,6 @@ Global {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.DebugMac|Any CPU.Build.0 = Debug|Any CPU {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.Release|Any CPU.Build.0 = Release|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {60AF04BE-1B6B-411B-BCBA-C95EAFBD7AC0}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.Release|Any CPU.Build.0 = Release|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {070E46F6-916C-4987-8F90-C0CEF1572FFE}.ReleaseMac|Any CPU.ActiveCfg = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU -- cgit v1.2.3 From ed5d86c600974ba477295417bb49772e2e13c441 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 18:49:41 -0500 Subject: Remove tests project as test --- Xamarin.PropertyEditing-Mac.sln | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Xamarin.PropertyEditing-Mac.sln b/Xamarin.PropertyEditing-Mac.sln index 24b909e..a71f058 100644 --- a/Xamarin.PropertyEditing-Mac.sln +++ b/Xamarin.PropertyEditing-Mac.sln @@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac", "Xamarin.PropertyEditing.Mac\Xamarin.PropertyEditing.Mac.csproj", "{E8F4F0EB-C2B1-4116-8459-E076E0E0E485}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Tests", "Xamarin.PropertyEditing.Tests\Xamarin.PropertyEditing.Tests.csproj", "{BA78BFE9-B51A-476D-B949-BD764CB55807}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac.Standalone", "Xamarin.PropertyEditing.Mac.Standalone\Xamarin.PropertyEditing.Mac.Standalone.csproj", "{A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}" EndProject Global @@ -33,14 +31,6 @@ Global {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.Build.0 = Debug|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.Release|Any CPU.Build.0 = Release|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {BA78BFE9-B51A-476D-B949-BD764CB55807}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU -- cgit v1.2.3 From 073c7a9c13871ea0125208424ae9d06301920ac5 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:10:33 -0500 Subject: Try bumping to 101 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index ea38bea..8f73c70 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100", + "version": "6.0.101", "rollForward": "latestFeature" } } -- cgit v1.2.3 From c433cf7a403b61ae65700deee4a07a31e70888b6 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:18:05 -0500 Subject: Remove rollForward --- global.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/global.json b/global.json index 8f73c70..2a9ec01 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,5 @@ { "sdk": { - "version": "6.0.101", - "rollForward": "latestFeature" + "version": "6.0.101" } } -- cgit v1.2.3 From f6ab05cb04049606787a1bbebdefbfbec94bd500 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:24:42 -0500 Subject: Try removing workload --- bot-provisioning/dependencies.csx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index f759e51..ab7028b 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -3,12 +3,14 @@ using static Xamarin.Provisioning.ProvisioningScript; if (IsMac) { - DotNetCoreSdk ("../global.json") + DotNetCoreSdk ("../global.json"); +/* .Workload( "microsoft.net.sdk.macos", "12.0.101-preview.10.249", "https://aka.ms/dotnet6/nuget/index.json", "https://api.nuget.org/v3/index.json"); +*/ Xcode ("13.2.1").XcodeSelect (); } -- cgit v1.2.3 From 02878526c391471fba9bea55c7e3cfd47982a9fe Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:28:53 -0500 Subject: Add list-sdks to debug --- .build/automation/stages/validate.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index e3116d3..605affb 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -70,6 +70,12 @@ stages: provisioning_script: $(System.DefaultWorkingDirectory)/bot-provisioning/dependencies.csx provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token) + - task: DotNetCoreCLI@2 + displayName: 'dotnet --list-sdks ' + inputs: + command: custom + custom: '--list-sdks ' + - task: MSBuild@1 displayName: Build inputs: -- cgit v1.2.3 From 119341a8c471a9834573d7e734763a02d2e828cb Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:34:52 -0500 Subject: Try AzDO installing .net6 --- .build/automation/stages/validate.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 605affb..ee0acad 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -70,6 +70,12 @@ stages: provisioning_script: $(System.DefaultWorkingDirectory)/bot-provisioning/dependencies.csx provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token) + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 6.0.101' + inputs: + version: 6.0.101 + + steps: - task: DotNetCoreCLI@2 displayName: 'dotnet --list-sdks ' inputs: -- cgit v1.2.3 From 7ab404ef6a8b4321f43d2695f6ced7432b1f3851 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Fri, 14 Jan 2022 19:37:58 -0500 Subject: Fix YAML syntax --- .build/automation/stages/validate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index ee0acad..1e73fcf 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -75,7 +75,6 @@ stages: inputs: version: 6.0.101 - steps: - task: DotNetCoreCLI@2 displayName: 'dotnet --list-sdks ' inputs: -- cgit v1.2.3 From e022872e2237b7f5c1fc6d243627801d7a733512 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Sat, 15 Jan 2022 11:31:17 -0500 Subject: Use AzDO task to install .NET6 and remove test only changes --- .build/automation/stages/validate.yml | 8 ++--- Xamarin.PropertyEditing-Mac.sln | 64 ----------------------------------- bot-provisioning/dependencies.csx | 2 -- build.proj | 7 +--- 4 files changed, 3 insertions(+), 78 deletions(-) delete mode 100644 Xamarin.PropertyEditing-Mac.sln diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 1e73fcf..024fc4c 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -70,17 +70,13 @@ stages: provisioning_script: $(System.DefaultWorkingDirectory)/bot-provisioning/dependencies.csx provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token) + # Using the provisionator to switch to .NET6 doesn't currently work for some reason on Mac agents - + # it's only .NET5 and earlier SDKS listed after running it. So use the AzDO task instead. - task: UseDotNet@2 displayName: 'Use .Net Core sdk 6.0.101' inputs: version: 6.0.101 - - task: DotNetCoreCLI@2 - displayName: 'dotnet --list-sdks ' - inputs: - command: custom - custom: '--list-sdks ' - - task: MSBuild@1 displayName: Build inputs: diff --git a/Xamarin.PropertyEditing-Mac.sln b/Xamarin.PropertyEditing-Mac.sln deleted file mode 100644 index a71f058..0000000 --- a/Xamarin.PropertyEditing-Mac.sln +++ /dev/null @@ -1,64 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.25920.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing", "Xamarin.PropertyEditing\Xamarin.PropertyEditing.csproj", "{A0B6FE73-D046-4E1C-BA9D-F20683889C5A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac", "Xamarin.PropertyEditing.Mac\Xamarin.PropertyEditing.Mac.csproj", "{E8F4F0EB-C2B1-4116-8459-E076E0E0E485}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.PropertyEditing.Mac.Standalone", "Xamarin.PropertyEditing.Mac.Standalone\Xamarin.PropertyEditing.Mac.Standalone.csproj", "{A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - DebugMac|Any CPU = DebugMac|Any CPU - ReleaseMac|Any CPU = ReleaseMac|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.Release|Any CPU.Build.0 = Release|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {A0B6FE73-D046-4E1C-BA9D-F20683889C5A}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {E8F4F0EB-C2B1-4116-8459-E076E0E0E485}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {A8ADFD5D-26CE-446B-AACA-99F6CA26FE45}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = PrefixedHierarchical - $0.TextStylePolicy = $2 - $2.FileWidth = 80 - $2.scope = text/x-csharp - $0.CSharpFormattingPolicy = $3 - $3.NewLinesForBracesInAnonymousMethods = False - $3.NewLinesForBracesInControlBlocks = False - $3.NewLinesForBracesInAnonymousTypes = False - $3.NewLinesForBracesInObjectCollectionArrayInitializers = False - $3.NewLinesForBracesInLambdaExpressionBody = False - $3.NewLineForElse = False - $3.NewLineForCatch = False - $3.NewLineForFinally = False - $3.SpacingAfterMethodDeclarationName = True - $3.SpaceAfterMethodCallName = True - $3.scope = text/x-csharp - EndGlobalSection -EndGlobal diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index ab7028b..a5c5fc0 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -4,13 +4,11 @@ using static Xamarin.Provisioning.ProvisioningScript; if (IsMac) { DotNetCoreSdk ("../global.json"); -/* .Workload( "microsoft.net.sdk.macos", "12.0.101-preview.10.249", "https://aka.ms/dotnet6/nuget/index.json", "https://api.nuget.org/v3/index.json"); -*/ Xcode ("13.2.1").XcodeSelect (); } diff --git a/build.proj b/build.proj index 07233c8..de89c64 100644 --- a/build.proj +++ b/build.proj @@ -38,12 +38,7 @@ - - - - - - + -- cgit v1.2.3 From 077ece0fdcbdb7ea358175fb7b528b75a3332396 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Sat, 15 Jan 2022 12:13:55 -0500 Subject: Fix syntax error --- bot-provisioning/dependencies.csx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index a5c5fc0..f759e51 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -3,7 +3,7 @@ using static Xamarin.Provisioning.ProvisioningScript; if (IsMac) { - DotNetCoreSdk ("../global.json"); + DotNetCoreSdk ("../global.json") .Workload( "microsoft.net.sdk.macos", "12.0.101-preview.10.249", -- cgit v1.2.3 From 451a97ce7a0ffbb885ab753c041ede23bd23d960 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Sat, 15 Jan 2022 12:19:39 -0500 Subject: Fix build.proj --- build.proj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.proj b/build.proj index de89c64..9fa0342 100644 --- a/build.proj +++ b/build.proj @@ -38,7 +38,9 @@ - + + + -- cgit v1.2.3 From 6e4a3e2805dfc6e5ebc4a39d99a1871a837c1952 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Sat, 15 Jan 2022 20:22:57 -0500 Subject: Move use dotnet before provisionator --- .build/automation/stages/validate.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 024fc4c..2df9f7c 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -55,6 +55,13 @@ stages: clean: true persistCredentials: true + # Using the provisionator to switch to .NET6 doesn't currently work for some reason on Mac agents - + # it's only .NET5 and earlier SDKS listed after running it. So use the AzDO task instead. + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 6.0.101' + inputs: + version: 6.0.101 + - task: NuGetAuthenticate@0 - task: CmdLine@1 @@ -70,13 +77,6 @@ stages: provisioning_script: $(System.DefaultWorkingDirectory)/bot-provisioning/dependencies.csx provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token) - # Using the provisionator to switch to .NET6 doesn't currently work for some reason on Mac agents - - # it's only .NET5 and earlier SDKS listed after running it. So use the AzDO task instead. - - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 6.0.101' - inputs: - version: 6.0.101 - - task: MSBuild@1 displayName: Build inputs: -- cgit v1.2.3 From 9678bf3f23476897a0e7d7878d92d3f635e41329 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 13:24:42 -0500 Subject: Switch to internal-macos1100 agent on Maac --- .build/automation/stages/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 2df9f7c..a94ce40 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -48,7 +48,7 @@ stages: - job: 'MacOS' pool: - vmImage: 'macOS-latest' + vmImage: 'internal-macos1100' steps: - checkout: self -- cgit v1.2.3 From 1d122787dcce92a44ee734f3daae6b3d2ae7ce5e Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 14:50:44 -0500 Subject: Show .net env info in CI, for testing --- .build/automation/stages/validate.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index a94ce40..0f7662f 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -62,6 +62,11 @@ stages: inputs: version: 6.0.101 + - bash: | + which dotnet + dotnet --list-sdks + displayName: Show environment info + - task: NuGetAuthenticate@0 - task: CmdLine@1 -- cgit v1.2.3 From 661cf85f1f142531d2f3a8521d5c520f3bed6ad0 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 16:00:05 -0500 Subject: Add dotnet to path --- .build/automation/stages/validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 0f7662f..1b778ec 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -62,6 +62,10 @@ stages: inputs: version: 6.0.101 + - bash: | + export PATH=/usr/local/share/dotnet:$(PATH) + displayName: Add dotnet to path + - bash: | which dotnet dotnet --list-sdks -- cgit v1.2.3 From 3ad7445dcc1a344ca048cfb13176a6568e7da11a Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 16:20:57 -0500 Subject: Make provisionator use .net root --- .build/automation/stages/validate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 1b778ec..4d4b44a 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -69,6 +69,7 @@ stages: - bash: | which dotnet dotnet --list-sdks + printenv DOTNET_ROOT displayName: Show environment info - task: NuGetAuthenticate@0 -- cgit v1.2.3 From 36ffdfcf9d984d2071db3c62dcd066df679cb8e6 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 16:49:05 -0500 Subject: Set installDirectory for DotNetCoreSdk task --- bot-provisioning/dependencies.csx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index f759e51..3abd0b6 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -3,7 +3,7 @@ using static Xamarin.Provisioning.ProvisioningScript; if (IsMac) { - DotNetCoreSdk ("../global.json") + DotNetCoreSdk ("../global.json", installDirectory: Env("DOTNET_ROOT")) .Workload( "microsoft.net.sdk.macos", "12.0.101-preview.10.249", -- cgit v1.2.3 From b99d94f7af0cc5e1960b0d2f650f3a8aa06031f0 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 17:01:16 -0500 Subject: Remove debugging pipeline step --- .build/automation/stages/validate.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 4d4b44a..d8b3982 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -55,23 +55,6 @@ stages: clean: true persistCredentials: true - # Using the provisionator to switch to .NET6 doesn't currently work for some reason on Mac agents - - # it's only .NET5 and earlier SDKS listed after running it. So use the AzDO task instead. - - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 6.0.101' - inputs: - version: 6.0.101 - - - bash: | - export PATH=/usr/local/share/dotnet:$(PATH) - displayName: Add dotnet to path - - - bash: | - which dotnet - dotnet --list-sdks - printenv DOTNET_ROOT - displayName: Show environment info - - task: NuGetAuthenticate@0 - task: CmdLine@1 -- cgit v1.2.3 From 94ce0b89075fca7b81019f9d72da871612ca9942 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Tue, 18 Jan 2022 21:33:07 -0500 Subject: Switch agent back to macOS-latest --- .build/automation/stages/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index d8b3982..e3116d3 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -48,7 +48,7 @@ stages: - job: 'MacOS' pool: - vmImage: 'internal-macos1100' + vmImage: 'macOS-latest' steps: - checkout: self -- cgit v1.2.3 From 6ae2c96e03575ce710c1af9b5d97492ba5a6d4ac Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Wed, 19 Jan 2022 12:38:20 -0500 Subject: Run tests now with dotnet test --- .build/automation/stages/validate.yml | 2 +- .../Xamarin.PropertyEditing.Tests.csproj | 11 ++--------- build.proj | 9 +++------ 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index e3116d3..29540f2 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -88,5 +88,5 @@ stages: displayName: 'Publish Test Results' inputs: testResultsFormat: NUnit - testResultsFiles: '**/TestResult.xml' + testResultsFiles: '**/*.Tests.xml' condition: succeededOrFailed() diff --git a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj index 78474b4..755c780 100644 --- a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj +++ b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj @@ -1,22 +1,15 @@  - - net6.0 - - - net472 - - - $(MSBuildThisFileDirectory)packages\ + net6.0 - + diff --git a/build.proj b/build.proj index 9fa0342..d0c5b42 100644 --- a/build.proj +++ b/build.proj @@ -27,16 +27,13 @@ $(CommonBuildProperties);Configuration=$(Configuration) + Xamarin.PropertyEditing.Tests\ Xamarin.PropertyEditing.Tests\bin\ Xamarin.PropertyEditing.Tests.dll - out + $(MSBuildThisFileDirectory)out - - - - @@ -62,7 +59,7 @@ - + -- cgit v1.2.3 From 513263ab8e007bbd31638179f4fe7d628aad217f Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Wed, 19 Jan 2022 13:21:04 -0500 Subject: Switch tests back to .net472 for windows --- Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj index 755c780..ddc768d 100644 --- a/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj +++ b/Xamarin.PropertyEditing.Tests/Xamarin.PropertyEditing.Tests.csproj @@ -1,8 +1,11 @@ - + - + net6.0 + + net472 + -- cgit v1.2.3 From a4c0986f308c032fbc9f5410f6020a85307b5f0a Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Thu, 20 Jan 2022 14:02:30 -0500 Subject: Undo add of Set Token --- .build/automation/stages/validate.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 29540f2..6645693 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -12,12 +12,6 @@ stages: clean: true persistCredentials: true - - task: CmdLine@1 - displayName: 'Set Token' - inputs: - filename: echo - arguments: '##vso[task.setvariable variable=GITHUB_TOKEN]$(GitHub.Token)' - - task: provisionator@2 displayName: Provision Dependencies inputs: -- cgit v1.2.3 From aa8ed0016ab40bf74d1ac4357437c64b2f3f69a6 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Thu, 20 Jan 2022 16:12:34 -0500 Subject: Remove SetToken on Mac too --- .build/automation/stages/validate.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.build/automation/stages/validate.yml b/.build/automation/stages/validate.yml index 6645693..d59b470 100644 --- a/.build/automation/stages/validate.yml +++ b/.build/automation/stages/validate.yml @@ -51,12 +51,6 @@ stages: - task: NuGetAuthenticate@0 - - task: CmdLine@1 - displayName: 'Set Token' - inputs: - filename: echo - arguments: '##vso[task.setvariable variable=GITHUB_TOKEN]$(GitHub.Token)' - - task: provisionator@2 displayName: Provision Dependencies inputs: -- cgit v1.2.3 From c0f4d68b053b50e9157fbfef150e4589c1f3100e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Wed, 2 Feb 2022 11:08:55 +0100 Subject: Fixed NSColor dispose side effect. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1455310 Bug 1455310: [Feedback] Editor theme is not correctly updated when the theme changes (VS for Mac 2022 Preview 4) --- .../Controls/Custom/DynamicBox.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs index 7a6aedd..d836877 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs @@ -14,14 +14,14 @@ namespace Xamarin.PropertyEditing.Mac BorderWidth = 0; BoxType = NSBoxType.NSBoxCustom; TranslatesAutoresizingMaskIntoConstraints = false; - + this.WantsLayer = true; this.fillColor = fillName; if (fillName == null) - FillColor = NSColor.Clear; + this.Layer.BackgroundColor = NSColor.Clear.CGColor; this.borderColor = borderName; if (borderName == null) - BorderColor = NSColor.Clear; + this.Layer.BorderColor = NSColor.Clear.CGColor; HostResourceProvider = hostResources; } @@ -43,7 +43,7 @@ namespace Xamarin.PropertyEditing.Mac { this.fillColor = value; if (value == null) - FillColor = NSColor.Clear; + this.Layer.BackgroundColor = NSColor.Clear.CGColor; AppearanceChanged (); } @@ -56,7 +56,7 @@ namespace Xamarin.PropertyEditing.Mac { this.borderColor = value; if (value == null) - BorderColor = NSColor.Clear; + this.Layer.BorderColor = NSColor.Clear.CGColor; AppearanceChanged (); } @@ -78,16 +78,14 @@ namespace Xamarin.PropertyEditing.Mac NSColor color = this.hostResources.GetNamedColor (this.fillColor); if (color == null) return; - - FillColor = color; + this.Layer.BackgroundColor = color.CGColor; } if (this.borderColor != null) { NSColor color = this.hostResources.GetNamedColor (this.borderColor); if (color == null) return; - - BorderColor = color; + this.Layer.BorderColor = color.CGColor; } } } -- cgit v1.2.3 From 9bf088da711d4beb5a194cb636a3bdee7ba2676c Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Mon, 7 Feb 2022 00:12:43 -0500 Subject: Protect against CurrentAppearance NRE Fix AB#1468252 Apparently there are scenarios where CurrentAppearance is not set by the client on HostResourceProvider (UITools sets it but vsmac doesn't currently) nor is NSAppearance.CurrentAppearance set on the current thread (perhaps the thread is newly created and AppKit didn't get a chance to set it), causing bug 1468252. To protect against that, we check if both are null and in that case just assume it's light theme rather than generate an NRE. --- Xamarin.PropertyEditing.Mac/HostResourceProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs index 4d42f06..dd2b224 100644 --- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs +++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs @@ -39,7 +39,8 @@ namespace Xamarin.PropertyEditing.Mac public virtual NSImage GetNamedImage (string name) { - if ((CurrentAppearance ?? NSAppearance.CurrentAppearance).Name.ToLower ().Contains ("dark")) { + NSAppearance currentAppearance = CurrentAppearance ?? NSAppearance.CurrentAppearance; + if (currentAppearance != null && currentAppearance.Name.ToLower ().Contains ("dark")) { bool sel = name.EndsWith ("~sel"); if (sel) name = name.Substring (0, name.Length - 4); -- cgit v1.2.3 From 0e6f75eba8b941cc700e872c346f4cee11fe08e8 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Mon, 7 Feb 2022 10:20:27 -0800 Subject: Prepare for nfloat moving to ObjCRuntime namespace This change landed in the macOS workload between preview 10 and 11. --- .../Controls/BindingEditor/BindingEditorWindow.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/BindingEditor/HeaderView.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/ColorComponentEditor.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/DrawingExtensions.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/PropertyContainer.cs | 1 + .../Controls/RequestResource/ResourceTableDelegate.cs | 1 + Xamarin.PropertyEditing.Mac/HostResourceProvider.cs | 1 + Xamarin.PropertyEditing.Mac/IHostResourceProvider.cs | 1 + Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs | 1 + 13 files changed, 13 insertions(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BindingEditorWindow.cs b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BindingEditorWindow.cs index 3413bb9..734a0f8 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BindingEditorWindow.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BindingEditorWindow.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Common; using Xamarin.PropertyEditing.ViewModels; diff --git a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/HeaderView.cs b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/HeaderView.cs index 833a76b..7e9a5c6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/HeaderView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/HeaderView.cs @@ -2,6 +2,7 @@ using System; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorComponentEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorComponentEditor.cs index 47caf85..d958e58 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorComponentEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorComponentEditor.cs @@ -4,6 +4,7 @@ using System.Linq; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.ViewModels; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs index fe9200d..4afdc76 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; namespace Xamarin.PropertyEditing.Mac diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/DrawingExtensions.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/DrawingExtensions.cs index 988c9cd..cf87d01 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/DrawingExtensions.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/DrawingExtensions.cs @@ -2,6 +2,7 @@ using System; using AppKit; using CoreGraphics; using CoreImage; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; namespace Xamarin.PropertyEditing.Mac diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs index 45a93b3..7e15a44 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/MaterialView.cs @@ -6,6 +6,7 @@ using AppKit; using CoreAnimation; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.ViewModels; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs index 831dfff..de6f661 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs @@ -3,6 +3,7 @@ using System; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs index 40304bc..80ee61a 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/SolidColorBrushEditor.cs @@ -5,6 +5,7 @@ using System.Linq; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.ViewModels; diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyContainer.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyContainer.cs index 73a7f5b..8deacbb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyContainer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyContainer.cs @@ -1,6 +1,7 @@ using System; using System.Threading; using AppKit; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { diff --git a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs index c05abc9..ad8738c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using AppKit; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.ViewModels; diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs index dd2b224..42720a8 100644 --- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs +++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs @@ -2,6 +2,7 @@ using System; using System.IO; using AppKit; using Foundation; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { diff --git a/Xamarin.PropertyEditing.Mac/IHostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/IHostResourceProvider.cs index 3fb3619..8fd8188 100644 --- a/Xamarin.PropertyEditing.Mac/IHostResourceProvider.cs +++ b/Xamarin.PropertyEditing.Mac/IHostResourceProvider.cs @@ -1,5 +1,6 @@ using System; using AppKit; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs index 9410bc5..0a86e58 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading; using AppKit; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.ViewModels; -- cgit v1.2.3 From 1b05dd9c0660131997d4e81f77ae3238a30fec99 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Tue, 8 Feb 2022 12:41:04 -0800 Subject: Add nfloat cast --- Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs index 0a86e58..a38bd55 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs @@ -212,7 +212,7 @@ namespace Xamarin.PropertyEditing.Mac this.registrations[cellIdentifier] = registration; } - return registration.GetHeight (vm); + return (nfloat) registration.GetHeight (vm); } private class EditorRegistration -- cgit v1.2.3 From c6b1e4d5e74f0ec70e0b22a5b3e83517c14b3ec2 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Tue, 8 Feb 2022 14:35:19 -0800 Subject: IntPtr->NativeHandle migration https://github.com/xamarin/xamarin-macios/blob/main/dotnet/BreakingChanges.md#nsobjecthandle-and-inativeobjecthandle-changed-type-from-systemintptr-to-objcruntimenativehandle --- Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs | 2 +- .../MockedSampleControlButton.cs | 2 +- Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs | 2 +- .../Controls/BindingEditor/BaseSelectorOutlineView.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorLayer.cs | 7 ++++--- Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorView.cs | 5 +++-- .../Controls/Custom/CommonGradientBrushLayer.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/Custom/HistoryLayer.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/HueLayer.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/ResourceOutlineView.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/ShadeLayer.cs | 3 ++- Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs | 3 ++- 12 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs index 81e9957..ed44523 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs @@ -8,7 +8,7 @@ namespace Xamarin.PropertyEditing.Mac.Standalone public class MockedAppKitButton : MockedControlButton { // Called when created from unmanaged code - public MockedAppKitButton (IntPtr handle) : base (new MockNSButton (), handle) + public MockedAppKitButton (NativeHandle handle) : base (new MockNSButton (), handle) { } diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs index 8a441a7..4a19332 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs @@ -8,7 +8,7 @@ namespace Xamarin.PropertyEditing.Mac.Standalone public class MockedSampleControlButton : MockedControlButton { // Called when created from unmanaged code - public MockedSampleControlButton (IntPtr handle) : base (new MockSampleControl (), handle) + public MockedSampleControlButton (NativeHandle handle) : base (new MockSampleControl (), handle) { } diff --git a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs index 535dffe..ab295e3 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs @@ -10,7 +10,7 @@ namespace Xamarin.PropertyEditing.Mac.Standalone { public partial class ViewController : NSViewController { - public ViewController (IntPtr handle) : base (handle) + public ViewController (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BaseSelectorOutlineView.cs b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BaseSelectorOutlineView.cs index e18c197..b26b06f 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BaseSelectorOutlineView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BindingEditor/BaseSelectorOutlineView.cs @@ -1,6 +1,7 @@ using System; using AppKit; using Foundation; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { @@ -12,7 +13,7 @@ namespace Xamarin.PropertyEditing.Mac } // Called when created from unmanaged code - public BaseSelectorOutlineView (IntPtr handle) : base (handle) + public BaseSelectorOutlineView (NativeHandle handle) : base (handle) { Initialize (); } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorLayer.cs index 6657ba1..68f3cfc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorLayer.cs @@ -2,6 +2,7 @@ using System; using CoreAnimation; using CoreGraphics; using Foundation; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { @@ -16,7 +17,7 @@ namespace Xamarin.PropertyEditing.Mac return null; } - public ColorEditorLayer (IntPtr handle) : base (handle) + public ColorEditorLayer (NativeHandle handle) : base (handle) { } @@ -31,7 +32,7 @@ namespace Xamarin.PropertyEditing.Mac { } - public UnanimatedGradientLayer (IntPtr handle) : base (handle) + public UnanimatedGradientLayer (NativeHandle handle) : base (handle) { } @@ -47,7 +48,7 @@ namespace Xamarin.PropertyEditing.Mac { } - public UnanimatedLayer (IntPtr handle) : base (handle) + public UnanimatedLayer (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorView.cs index 21f4753..bef2ff2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ColorEditorView.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.ViewModels; namespace Xamarin.PropertyEditing.Mac @@ -25,7 +26,7 @@ namespace Xamarin.PropertyEditing.Mac Adaptor = new NotifyingViewAdaptor (this); } - public NotifyingView (IntPtr handle) : base (handle) + public NotifyingView (NativeHandle handle) : base (handle) { } @@ -60,7 +61,7 @@ namespace Xamarin.PropertyEditing.Mac { protected const float Padding = 3; - public ColorEditorView (IntPtr handle) : base (handle) + public ColorEditorView (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs index 4afdc76..4eb0799 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonGradientBrushLayer.cs @@ -13,7 +13,7 @@ namespace Xamarin.PropertyEditing.Mac { } - public CommonGradientBrushLayer (IntPtr handle) : base (handle) + public CommonGradientBrushLayer (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/HistoryLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/HistoryLayer.cs index e56786b..9f90d61 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/HistoryLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/HistoryLayer.cs @@ -2,6 +2,7 @@ using System; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { @@ -22,7 +23,7 @@ namespace Xamarin.PropertyEditing.Mac lastClip.AddSublayer (last); } - public HistoryLayer (IntPtr handle) : base (handle) + public HistoryLayer (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/HueLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/HueLayer.cs index c67b138..1fba98a 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/HueLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/HueLayer.cs @@ -2,6 +2,7 @@ using System; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; namespace Xamarin.PropertyEditing.Mac @@ -23,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac Initialize (); } - public HueLayer (IntPtr handle) : base (handle) + public HueLayer (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ResourceOutlineView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ResourceOutlineView.cs index 7437ae2..63df3d5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ResourceOutlineView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ResourceOutlineView.cs @@ -2,6 +2,7 @@ using AppKit; using CoreGraphics; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.ViewModels; namespace Xamarin.PropertyEditing.Mac @@ -18,7 +19,7 @@ namespace Xamarin.PropertyEditing.Mac } // Called when created from unmanaged code - public ResourceOutlineView (IntPtr handle) : base (handle) + public ResourceOutlineView (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ShadeLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ShadeLayer.cs index 045116e..166f1f4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ShadeLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ShadeLayer.cs @@ -2,6 +2,7 @@ using System; using AppKit; using CoreAnimation; using CoreGraphics; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { @@ -31,7 +32,7 @@ namespace Xamarin.PropertyEditing.Mac }); } - public ShadeLayer (IntPtr handle) : base (handle) + public ShadeLayer (NativeHandle handle) : base (handle) { } diff --git a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs index ad62967..fc2d975 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyEditorPanel.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using CoreGraphics; using Foundation; using AppKit; +using ObjCRuntime; using Xamarin.PropertyEditing.ViewModels; @@ -26,7 +27,7 @@ namespace Xamarin.PropertyEditing.Mac } // Called when created from unmanaged code - public PropertyEditorPanel (IntPtr handle) : base (handle) + public PropertyEditorPanel (NativeHandle handle) : base (handle) { this.hostResources = new HostResourceProvider (); Initialize (); -- cgit v1.2.3 From d2e9af4aeb25832289321d38cbf96bcee313e3cf Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Fri, 11 Feb 2022 11:25:07 -0800 Subject: API breaks for P13 --- Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/Custom/AutoClosePopOver.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index cb8bc44..53b5513 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -129,7 +129,7 @@ namespace Xamarin.PropertyEditing.Mac { base.AppearanceChanged (); - this.popover.SetAppearance (HostResources.GetVibrantAppearance (EffectiveAppearance)); + this.popover.Appearance = HostResources.GetVibrantAppearance (EffectiveAppearance); this.popover.ContentViewController.View.Appearance = EffectiveAppearance; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs index 51a0f8a..15ad083 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs @@ -299,7 +299,7 @@ namespace Xamarin.PropertyEditing.Mac public override bool WriteRows (NSTableView tableView, NSIndexSet rowIndexes, NSPasteboard pboard) { var item = new NSPasteboardItem (); - item.SetDataForType (NSKeyedArchiver.ArchivedDataWithRootObject (rowIndexes), DataTypeName); + item.SetDataForType (NSKeyedArchiver.GetArchivedData (rowIndexes), DataTypeName); pboard.WriteObjects (new[] { item }); return true; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/AutoClosePopOver.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/AutoClosePopOver.cs index bb1fafd..f516c13 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/AutoClosePopOver.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/AutoClosePopOver.cs @@ -21,7 +21,7 @@ namespace Xamarin.PropertyEditing.Mac Delegate = new PopoverFocusRestoreDelegate (); CloseOnEnter = true; - this.SetAppearance (this.hostResources.GetVibrantAppearance (effectiveAppearance)); + Appearance = this.hostResources.GetVibrantAppearance (effectiveAppearance); } public override void KeyUp (NSEvent theEvent) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs index e4bea5e..b5c27b4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/BasePopOverControl.cs @@ -68,7 +68,7 @@ namespace Xamarin.PropertyEditing.Mac protected void AppearanceChanged() { - this.SetAppearance (HostResources.GetVibrantAppearance (EffectiveAppearance)); + Appearance = HostResources.GetVibrantAppearance (EffectiveAppearance); this.viewTitle.TextColor = HostResources.GetNamedColor (NamedResources.DescriptionLabelColor); } } -- cgit v1.2.3 From cc7eaa0ec98a8afb4e6818041e96d3ffa2d58e54 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Wed, 16 Feb 2022 11:04:13 -0800 Subject: Mac: NSDraggingInfo breaks in P13, use INSDraggingInfo https://github.com/xamarin/xamarin-macios/issues/14170 --- Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs index 15ad083..6bb5105 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionEditorControl.cs @@ -304,7 +304,8 @@ namespace Xamarin.PropertyEditing.Mac return true; } - public override NSDragOperation ValidateDrop (NSTableView tableView, NSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) + [Export ("tableView:validateDrop:proposedRow:proposedDropOperation:")] + public NSDragOperation ValidateDrop (NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) { if (info.DraggingPasteboard.GetDataForType (DataTypeName) != null) return NSDragOperation.Move; @@ -312,7 +313,8 @@ namespace Xamarin.PropertyEditing.Mac return NSDragOperation.None; } - public override bool AcceptDrop (NSTableView tableView, NSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) + [Export ("tableView:acceptDrop:row:dropOperation:")] + public bool AcceptDrop (NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) { NSData data = info.DraggingPasteboard.GetDataForType (DataTypeName); NSIndexSet indexes = NSKeyedUnarchiver.UnarchiveObject (data) as NSIndexSet; -- cgit v1.2.3 From 5b5c11804e69a5f4a3cfe6ecec06089a9d995148 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Wed, 16 Feb 2022 11:05:08 -0800 Subject: Bump macos workload to P13 --- Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs | 1 + Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs | 1 + Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs | 1 + bot-provisioning/dependencies.csx | 2 +- global.json | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs index ed44523..89c9948 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/MockedAppKitButton.cs @@ -1,5 +1,6 @@ using System; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Tests.MockControls; namespace Xamarin.PropertyEditing.Mac.Standalone diff --git a/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs b/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs index 4a19332..fc1edd2 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/MockedSampleControlButton.cs @@ -1,5 +1,6 @@ using System; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Tests.MockControls; namespace Xamarin.PropertyEditing.Mac.Standalone diff --git a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs index ab295e3..bf91b8f 100644 --- a/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs +++ b/Xamarin.PropertyEditing.Mac.Standalone/ViewController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using AppKit; using Foundation; +using ObjCRuntime; using Xamarin.PropertyEditing.Drawing; using Xamarin.PropertyEditing.Tests; diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index 3abd0b6..6f5da31 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -6,7 +6,7 @@ if (IsMac) { DotNetCoreSdk ("../global.json", installDirectory: Env("DOTNET_ROOT")) .Workload( "microsoft.net.sdk.macos", - "12.0.101-preview.10.249", + "12.1.301-preview.13.4", "https://aka.ms/dotnet6/nuget/index.json", "https://api.nuget.org/v3/index.json"); diff --git a/global.json b/global.json index 2a9ec01..a2ce2ee 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.101" + "version": "6.0.200" } } -- cgit v1.2.3 From b7667fbb611fdf6ead485416b6e9ec83d613485e Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Thu, 17 Feb 2022 05:55:55 -0800 Subject: Bump to P13.7 --- bot-provisioning/dependencies.csx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot-provisioning/dependencies.csx b/bot-provisioning/dependencies.csx index 6f5da31..33f1054 100644 --- a/bot-provisioning/dependencies.csx +++ b/bot-provisioning/dependencies.csx @@ -6,7 +6,7 @@ if (IsMac) { DotNetCoreSdk ("../global.json", installDirectory: Env("DOTNET_ROOT")) .Workload( "microsoft.net.sdk.macos", - "12.1.301-preview.13.4", + "12.1.301-preview.13.7", "https://aka.ms/dotnet6/nuget/index.json", "https://api.nuget.org/v3/index.json"); -- cgit v1.2.3 From 7de9cf172e998e18caed055eb63edf155bd7a063 Mon Sep 17 00:00:00 2001 From: Bret Johnson Date: Thu, 24 Feb 2022 18:16:32 -0500 Subject: Add cast to fix bug with numeric conversion With the macos P13 API type changes, an issue was introduced since casting an ObjCRuntime.nfloat to an nint (aka IntPtr) doesn't work properly - (nint)(ObjCRuntime.nfloat)23 for instance will evaluate to 0x4037000000000000, the floating point bits are just reinterpreted as an int rather than actually being converted. That in turn caused huge sizes for width and height causing new CGBitmapContext to throw an exception. Adding the double cast here fixes this, for now. Soon ObjCRuntime.nfloat will go away, replaced by System.Runtime.InteropServices.NFloat, but for now this workaround makes us work. Fixes: AB#1487089 AB#1487070 AB#1487089 --- Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs | 7 +++++-- Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs index 9fce3f7..ac76c0d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs @@ -84,8 +84,11 @@ namespace Xamarin.PropertyEditing.Mac public NSImage RenderPreview () { var scale = this.ContentsScale; - nint h = (nint)(this.Bounds.Height * scale); - nint w = (nint)(this.Bounds.Width * scale); + // The double cast below is needed for now, while Width/Height/scale are of type ObjCRuntime.nfloat + // in order for the floating point to integral conversion to work properly. Later when ObjCRuntime.nfloat + // is replaced with System.Runtime.InteropServices.NFloat that won't be needed (but can't hurt). + nint h = (nint)(double)(this.Bounds.Height * scale); + nint w = (nint)(double)(this.Bounds.Width * scale); nint bytesPerRow = w * 4; if (h <= 0 || w <= 0) diff --git a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs index a38bd55..fa71c50 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyTableDelegate.cs @@ -212,7 +212,11 @@ namespace Xamarin.PropertyEditing.Mac this.registrations[cellIdentifier] = registration; } - return (nfloat) registration.GetHeight (vm); + // The double cast below is needed for now, while the return value is type ObjCRuntime.nfloat + // in order for the integral to floating point conversion to work properly. Later when ObjCRuntime.nfloat + // is replaced with System.Runtime.InteropServices.NFloat that won't be needed (but can't hurt). + nfloat rowHeight = (nfloat)(double)registration.GetHeight (vm); + return rowHeight; } private class EditorRegistration -- cgit v1.2.3 From 54f1bc4e7e4f20263df70e86ebf6c1ea5fd603a9 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:08:02 +0100 Subject: Fixes NRE if get row view is not ready to get the view and focus --- Xamarin.PropertyEditing.Mac/PropertyList.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/PropertyList.cs b/Xamarin.PropertyEditing.Mac/PropertyList.cs index 8e242a1..027b21f 100644 --- a/Xamarin.PropertyEditing.Mac/PropertyList.cs +++ b/Xamarin.PropertyEditing.Mac/PropertyList.cs @@ -129,7 +129,9 @@ namespace Xamarin.PropertyEditing.Mac SelectRow (0, false); this.tabbedIn = true; var row = GetRowView ((nint)SelectedRows.FirstIndex, false); - return Window.MakeFirstResponder (row.NextValidKeyView); + if (row != null) { + return Window.MakeFirstResponder (row.NextValidKeyView); + } } } this.tabbedIn = false; -- cgit v1.2.3 From 0f4a14a4c2968b212a4109cfc1eb89867cab1bdc Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:18:33 +0100 Subject: Creates ProxyRowResponder manage responder between rows in NSOutlineView --- .../Controls/ProxyRowResponder.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs diff --git a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs new file mode 100644 index 0000000..6f0784e --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs @@ -0,0 +1,48 @@ +using System; + +namespace Xamarin.PropertyEditing.Mac +{ + internal enum ProxyRowType + { + SingleView, + FirstView, + LastView + } + + internal class ProxyRowResponder + { + protected WeakReference editorControl; + + readonly ProxyRowType rowType; + + public ProxyRowResponder (PropertyEditorControl editorControl, ProxyRowType rowType) + { + this.rowType = rowType; + this.editorControl = new WeakReference (editorControl); + } + + public bool NextResponder() + { + if (this.editorControl.TryGetTarget (out var editor)) + { + if (this.rowType == ProxyRowType.LastView || this.rowType == ProxyRowType.SingleView) { + editor.OnNextResponderRequested (); + return true; + } + } + return false; + } + + public bool PreviousResponder () + { + if (this.editorControl.TryGetTarget (out var editor)) + { + if (this.rowType == ProxyRowType.FirstView || this.rowType == ProxyRowType.SingleView) { + editor.OnPreviousResponderRequested (); + return true; + } + } + return false; + } + } +} -- cgit v1.2.3 From 08840cce2a0120f1d8061f5c57e4ea2550a5e393 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:20:26 +0100 Subject: Removes old hack to set next responder for one based in KeyDown events --- .../Controls/PropertyEditorControl.cs | 94 ++++++++++++++-------- 1 file changed, 60 insertions(+), 34 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs index e2d5eb9..7899c8c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs @@ -64,43 +64,9 @@ namespace Xamarin.PropertyEditing.Mac NSView INativeContainer.NativeView => this; - [Export ("_primitiveSetDefaultNextKeyView:")] - public void SetDefaultNextKeyView (NSView child) - { - if (child == FirstKeyView || child == LastKeyView) { - UpdateKeyViews (); - } - } public virtual bool NeedsPropertyButton => true; - public void UpdateKeyViews () - { - if (TableView != null) { - nint row = TableView.RowForView (this); - if (row <= 0) - return; - - NSView view; - PropertyEditorControl ctrl = null; - do { - row--; - view = TableView.GetView (0, row, makeIfNecessary: false); - if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer - ctrl = pec; - } else { - ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; - } - } while (row > 0 && ctrl == null); - - if (ctrl != null) { - ctrl.LastKeyView.NextKeyView = FirstKeyView; - ctrl.UpdateKeyViews (); - } else if (row == 0 && view is PanelHeaderEditorControl header) { - header.SetNextKeyView (FirstKeyView); - } - } - } /// You should treat the implementation of this as static. public virtual nint GetHeight (EditorViewModel vm) @@ -146,6 +112,66 @@ namespace Xamarin.PropertyEditing.Mac AppearanceChanged (); } + + public void OnNextResponderRequested () + { + if (TableView != null) { + nint row = TableView.RowForView (this) + 1; + + NSView view; + PropertyEditorControl ctrl = null; + + for (; row < TableView.RowCount; row++) { + view = TableView.GetView (0, row, makeIfNecessary: false); + if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer + ctrl = pec; + } else { + ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; + } + + if (ctrl != null && !ctrl.viewModel.IsInputEnabled) { + ctrl = null; + } + + if (ctrl != null) { + Window?.MakeFirstResponder (ctrl.FirstKeyView); + return; + } + } + } + } + + public void OnPreviousResponderRequested () + { + if (TableView != null) { + nint row = TableView.RowForView (this) - 1; + + NSView view; + PropertyEditorControl ctrl = null; + + for (; row > 0; row--) + { + view = TableView.GetView (0, row, makeIfNecessary: false); + if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer + ctrl = pec; + } else { + ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; + } + + if (ctrl != null && !ctrl.viewModel.IsInputEnabled) { + ctrl = null; + } + + if (ctrl != null) { + Window?.MakeFirstResponder (ctrl.LastKeyView); + return; + } else if (row == 0 && view is PanelHeaderEditorControl header) { + Window?.MakeFirstResponder(header); + return; + } + } + } + } } internal abstract class PropertyEditorControl -- cgit v1.2.3 From 0a7bce75f503fb8847030b9a62a1acce3ef359e5 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:22:39 +0100 Subject: Creates ProxyResponderButton and makes base of FocusableBooleanButton --- .../Controls/Custom/FocusableBooleanButton.cs | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs index f8ed20d..01ad5e0 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs @@ -3,7 +3,28 @@ using AppKit; namespace Xamarin.PropertyEditing.Mac { - internal class FocusableBooleanButton : NSButton + internal class ProxyResponderButton : NSButton + { + public ProxyRowResponder ResponderProxy { get; set; } + + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ResponderProxy != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ResponderProxy.PreviousResponder (); + } else { + ResponderProxy.NextResponder (); + } + } + return; + } + base.KeyDown (theEvent); + } + } + + internal class FocusableBooleanButton : ProxyResponderButton { public override bool CanBecomeKeyView { get { return Enabled; } } -- cgit v1.2.3 From c90a281fa9a2e4131c851cc772f10c9c31a6092a Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:23:47 +0100 Subject: Makes NumericTextField a ProxyResponder class --- .../Controls/Custom/NumericTextField.cs | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index 4c215b7..7f324cf 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -51,6 +51,22 @@ namespace Xamarin.PropertyEditing.Mac Delegate = keyUpDownDelegate; } + public ProxyRowResponder ResponderProxy + { + get { + if (Delegate is KeyUpDownDelegate keydown) { + return keydown.ResponderProxy; + } + return null; + } + set + { + if (Delegate is KeyUpDownDelegate keydown) { + keydown.ResponderProxy = value; + } + } + } + public override CGSize IntrinsicContentSize => new CGSize(30, 20); public override bool ShouldBeginEditing (NSText textObject) @@ -156,14 +172,16 @@ namespace Xamarin.PropertyEditing.Mac } } - internal class KeyUpDownDelegate : NSTextFieldDelegate + internal class KeyUpDownDelegate : TextNextResponderDelegate { public event EventHandler KeyArrowUp; public event EventHandler KeyArrowDown; public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) { - switch (commandSelector.Name) { + if (!base.DoCommandBySelector(control, textView, commandSelector)) + { + switch (commandSelector.Name) { case "moveUp:": OnKeyArrowUp (); break; @@ -178,6 +196,7 @@ namespace Xamarin.PropertyEditing.Mac break; default: return false; + } } return true; -- cgit v1.2.3 From 45147ddbe52f859ed2f7d3f28172ac6eea33bc7b Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:24:14 +0100 Subject: Makes FocusablePopupButton a ProxyResponder class --- .../Controls/Custom/FocusablePopupButton.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index 988dc2b..7cdfcfc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -8,11 +8,29 @@ namespace Xamarin.PropertyEditing.Mac { public override bool CanBecomeKeyView { get { return Enabled; } } + public ProxyRowResponder ResponderProxy { get; set; } + public FocusablePopUpButton () { Cell.LineBreakMode = NSLineBreakMode.TruncatingMiddle; } + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ResponderProxy != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ResponderProxy.PreviousResponder (); + } else { + ResponderProxy.NextResponder (); + } + } + return; + } + base.KeyDown (theEvent); + } + public override bool BecomeFirstResponder () { var willBecomeFirstResponder = base.BecomeFirstResponder (); -- cgit v1.2.3 From 685039bab71ed5c40a128e9cf67f898e83e379c3 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:24:32 +0100 Subject: Makes FocusableComboBox a ProxyResponder class --- .../Controls/Custom/FocusableComboBox.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs index 577ce4b..d75dde2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -5,6 +5,24 @@ namespace Xamarin.PropertyEditing.Mac { internal class FocusableComboBox : NSComboBox { + public ProxyRowResponder ResponderProxy { get; set; } + + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ResponderProxy != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ResponderProxy.PreviousResponder (); + } else { + ResponderProxy.NextResponder (); + } + } + return; + } + base.KeyDown (theEvent); + } + public override bool BecomeFirstResponder () { var willBecomeFirstResponder = base.BecomeFirstResponder (); -- cgit v1.2.3 From 0cd914209735725f17a755fba1907d95acce7005 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:26:59 +0100 Subject: Makes first and last focusable view in BasePathEditorControl use ProxyRowResponder --- .../Controls/BasePathEditorControl.cs | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs index 923281e..9164f8d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs @@ -23,11 +23,35 @@ namespace Xamarin.PropertyEditing.Mac private readonly NSObject[] objects; public override NSObject[] AccessibilityChildren { get => this.objects; } + private readonly TextNextResponderDelegate textNextResponderDelegate; + + class BasePathEditordDelegate : TextNextResponderDelegate + { + WeakReference> weakView; + + public BasePathEditordDelegate (BasePathEditorControl basePathEditorControl) + { + weakView = new WeakReference>(basePathEditorControl); + } + + public override void Changed (NSNotification notification) + { + if (this.weakView.TryGetTarget(out BasePathEditorControl t)) { + t.StoreCurrentValue (); + } + } + } + protected BasePathEditorControl (IHostResourceProvider hostResource) : base (hostResource) { this.currentTextField = new TextFieldSmallButtonContainer (); - this.currentTextField.Changed += CurrentTextField_Changed; + + this.textNextResponderDelegate = new BasePathEditordDelegate (this) + { + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + }; + this.currentTextField.Delegate = this.textNextResponderDelegate; AddSubview (this.currentTextField); #region Reveal handler -- cgit v1.2.3 From 22444972b8da17fe5146992866afd14fe75ff112 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:28:07 +0100 Subject: NumericSpinEditor uses the internal view ResponderProxy --- Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs index de6f661..0d44862 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs @@ -172,6 +172,12 @@ namespace Xamarin.PropertyEditing.Mac set { this.numericEditor.AccessibilityTitle = value; } } + public ProxyRowResponder ResponderProxy + { + get => this.numericEditor.ResponderProxy; + set => this.numericEditor.ResponderProxy = value; + } + public virtual void Reset () { } -- cgit v1.2.3 From c2e197ead76cb32c14977c841f986ce26f695308 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:29:05 +0100 Subject: Makes RatioEditorControl main view use ProxyRowResponder --- Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs index 7591c2b..88ff2cb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs @@ -16,6 +16,7 @@ namespace Xamarin.PropertyEditing.Mac base.TranslatesAutoresizingMaskIntoConstraints = false; this.ratioEditor = new RatioEditor (hostResources); + this.ratioEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView); this.ratioEditor.SetFormatter (null); // update the value on keypress -- cgit v1.2.3 From ecdbcea061ba4c4e5ba2963bf0cac0398638ae3e Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:29:35 +0100 Subject: Makes BasePointEditorControl first and last view use ProxyRowResponder --- Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs index e60f5f4..341f93e 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs @@ -28,6 +28,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; + XEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -39,6 +40,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; + YEditor.ResponderProxy = new ProxyRowResponder (this, ProxyRowType.LastView); YEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); -- cgit v1.2.3 From adfe160484da0ee3b70f15bbd5c50235a0eaf7a3 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:31:38 +0100 Subject: FocusableButton and TextFieldSmallButtonContainer are a ProxyResponder --- Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableButton.cs | 2 +- .../Controls/Custom/TextFieldSmallButtonContainer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableButton.cs index 9e3366d..9d7476d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableButton.cs @@ -3,7 +3,7 @@ using AppKit; namespace Xamarin.PropertyEditing.Mac { - internal class FocusableButton : NSButton + internal class FocusableButton : ProxyResponderButton { public override bool CanBecomeKeyView { get { return Enabled; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/TextFieldSmallButtonContainer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/TextFieldSmallButtonContainer.cs index 0dbeb28..99e35e2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/TextFieldSmallButtonContainer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/TextFieldSmallButtonContainer.cs @@ -6,7 +6,7 @@ using Foundation; namespace Xamarin.PropertyEditing.Mac { - internal class SmallButton : NSButton + internal class SmallButton : ProxyResponderButton { private NSView previousKeyView; public override NSView PreviousKeyView => this.previousKeyView ?? base.PreviousKeyView; -- cgit v1.2.3 From 7f0a7271fac6f78de8ec7d4d2c945f908759dbc3 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:32:52 +0100 Subject: Makes some basic editors use ProxyRowResponder in their views --- Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs | 2 ++ Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs | 5 ++++- Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs | 6 +++++- .../Controls/CollectionInlineEditorControl.cs | 1 + Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | 5 ++++- Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs | 2 ++ Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs | 4 +++- 8 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs index 005ef89..c03ce60 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs @@ -33,6 +33,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; + XEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -63,6 +64,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; + HeightEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.LastView); HeightEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs index d9541a6..47c40ce 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs @@ -11,7 +11,10 @@ namespace Xamarin.PropertyEditing.Mac public BooleanEditorControl (IHostResourceProvider hostResource) : base (hostResource) { - BooleanEditor = new FocusableBooleanButton (); + BooleanEditor = new FocusableBooleanButton () + { + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + }; BooleanEditor.Title = string.Empty; // update the value on 'enter' diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index 53b5513..aee5b0e 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -56,6 +56,7 @@ namespace Xamarin.PropertyEditing.Mac ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs index f68457d..c46ef2c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs @@ -13,7 +13,11 @@ namespace Xamarin.PropertyEditing.Mac protected override EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { - return new CharDelegate (viewModel); + var charDelegate = new CharDelegate (viewModel) + { + ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + }; + return charDelegate; } protected override void UpdateAccessibilityValues () diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs index 00608b1..88456c6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs @@ -24,6 +24,7 @@ namespace Xamarin.PropertyEditing.Mac Title = Properties.Resources.CollectionEditButton, BezelStyle = NSBezelStyle.Rounded, AccessibilityEnabled = true, + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView), AccessibilityHelp = Properties.Resources.AccessibilityCollectionHelp }; diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index e56debf..2950ae2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -16,7 +16,10 @@ namespace Xamarin.PropertyEditing.Mac { base.TranslatesAutoresizingMaskIntoConstraints = false; - NumericEditor = new NumericSpinEditor (hostResources); + NumericEditor = new NumericSpinEditor (hostResources) + { + ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + }; NumericEditor.ValueChanged += OnValueChanged; var t = typeof (T); diff --git a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs index f402bf7..0f7b056 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs @@ -113,6 +113,7 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); @@ -155,6 +156,7 @@ namespace Xamarin.PropertyEditing.Mac LineBreakMode = NSLineBreakMode.TruncatingTail, UsesSingleLineMode = true, }, + ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView), ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, diff --git a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs index 222af81..4c60dfc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs @@ -13,7 +13,9 @@ namespace Xamarin.PropertyEditing.Mac protected override EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { - return new TimeSpanDelegate (viewModel); + return new TimeSpanDelegate (viewModel) { + ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + }; } protected override void UpdateAccessibilityValues () -- cgit v1.2.3 From 0f046f5754d82963363a64fcf4394835d52c01b3 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 18:33:35 +0100 Subject: Makes EntryPropertyEditor use ProxyRowResponder --- .../Controls/EntryPropertyEditor.cs | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index f1d92ac..230c42d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -2,9 +2,34 @@ using System; using AppKit; using Foundation; using Xamarin.PropertyEditing.ViewModels; +using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { + class TextNextResponderDelegate : NSTextFieldDelegate + { + public ProxyRowResponder ResponderProxy { get; set; } + + public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) + { + switch (commandSelector.Name) { + case "insertTab:": + if (ResponderProxy?.NextResponder () ?? false) + { + return true; + } + break; + case "insertBacktab:": + if (ResponderProxy?.PreviousResponder () ?? false) + { + return true; + } + break; + } + return false; + } + } + internal abstract class EntryPropertyEditor : PropertyEditorControl> { @@ -61,7 +86,11 @@ namespace Xamarin.PropertyEditing.Mac protected virtual EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { - return new EntryPropertyEditorDelegate (viewModel); + var propertyEditorDelegate = new EntryPropertyEditorDelegate (viewModel) + { + ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + }; + return propertyEditorDelegate; } protected virtual string GetValue (T value) @@ -71,7 +100,7 @@ namespace Xamarin.PropertyEditing.Mac } internal class EntryPropertyEditorDelegate - : NSTextFieldDelegate + : TextNextResponderDelegate { public EntryPropertyEditorDelegate (PropertyViewModel viewModel) { -- cgit v1.2.3 From 5417507c3e076e2703f2cd2cd057aa0cb536a1ff Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Wed, 16 Feb 2022 19:07:57 +0100 Subject: Naming changes --- Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs | 4 ++-- .../Controls/BaseRectangleEditorControl.cs | 4 ++-- Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs | 2 +- .../Controls/CollectionInlineEditorControl.cs | 2 +- .../Controls/Custom/FocusableBooleanButton.cs | 8 ++++---- Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs | 8 ++++---- .../Controls/Custom/FocusablePopupButton.cs | 8 ++++---- Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs | 6 +++--- Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs | 6 +++--- Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs | 8 ++++---- Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs | 4 ++-- Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs | 4 ++-- Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs | 2 +- Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs | 2 +- 18 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs index 9164f8d..d1465cc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs @@ -49,7 +49,7 @@ namespace Xamarin.PropertyEditing.Mac this.textNextResponderDelegate = new BasePathEditordDelegate (this) { - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; this.currentTextField.Delegate = this.textNextResponderDelegate; AddSubview (this.currentTextField); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs index 341f93e..7300ed1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs @@ -28,7 +28,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -40,7 +40,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - YEditor.ResponderProxy = new ProxyRowResponder (this, ProxyRowType.LastView); + YEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); YEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs index c03ce60..8e426ee 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs @@ -33,7 +33,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -64,7 +64,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - HeightEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.LastView); + HeightEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); HeightEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs index 47c40ce..a6196f2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs @@ -13,7 +13,7 @@ namespace Xamarin.PropertyEditing.Mac { BooleanEditor = new FocusableBooleanButton () { - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; BooleanEditor.Title = string.Empty; diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index aee5b0e..c8413ec 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -56,7 +56,7 @@ namespace Xamarin.PropertyEditing.Mac ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs index c46ef2c..f6b22ff 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs @@ -15,7 +15,7 @@ namespace Xamarin.PropertyEditing.Mac { var charDelegate = new CharDelegate (viewModel) { - ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; return charDelegate; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs index 88456c6..0c839a3 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs @@ -24,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac Title = Properties.Resources.CollectionEditButton, BezelStyle = NSBezelStyle.Rounded, AccessibilityEnabled = true, - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView), + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), AccessibilityHelp = Properties.Resources.AccessibilityCollectionHelp }; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs index 01ad5e0..0f30939 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs @@ -5,17 +5,17 @@ namespace Xamarin.PropertyEditing.Mac { internal class ProxyResponderButton : NSButton { - public ProxyRowResponder ResponderProxy { get; set; } + public RowProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { switch (theEvent.KeyCode) { case (int)NSKey.Tab: - if (ResponderProxy != null) { + if (ProxyResponder != null) { if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { - ResponderProxy.PreviousResponder (); + ProxyResponder.PreviousResponder (); } else { - ResponderProxy.NextResponder (); + ProxyResponder.NextResponder (); } } return; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs index d75dde2..a9994c7 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -5,17 +5,17 @@ namespace Xamarin.PropertyEditing.Mac { internal class FocusableComboBox : NSComboBox { - public ProxyRowResponder ResponderProxy { get; set; } + public RowProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { switch (theEvent.KeyCode) { case (int)NSKey.Tab: - if (ResponderProxy != null) { + if (ProxyResponder != null) { if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { - ResponderProxy.PreviousResponder (); + ProxyResponder.PreviousResponder (); } else { - ResponderProxy.NextResponder (); + ProxyResponder.NextResponder (); } } return; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index 7cdfcfc..fa00bcf 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -8,7 +8,7 @@ namespace Xamarin.PropertyEditing.Mac { public override bool CanBecomeKeyView { get { return Enabled; } } - public ProxyRowResponder ResponderProxy { get; set; } + public RowProxyResponder ProxyResponder { get; set; } public FocusablePopUpButton () { @@ -19,11 +19,11 @@ namespace Xamarin.PropertyEditing.Mac { switch (theEvent.KeyCode) { case (int)NSKey.Tab: - if (ResponderProxy != null) { + if (ProxyResponder != null) { if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { - ResponderProxy.PreviousResponder (); + ProxyResponder.PreviousResponder (); } else { - ResponderProxy.NextResponder (); + ProxyResponder.NextResponder (); } } return; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs index 0d44862..d7d5253 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs @@ -172,10 +172,10 @@ namespace Xamarin.PropertyEditing.Mac set { this.numericEditor.AccessibilityTitle = value; } } - public ProxyRowResponder ResponderProxy + public RowProxyResponder ProxyResponder { - get => this.numericEditor.ResponderProxy; - set => this.numericEditor.ResponderProxy = value; + get => this.numericEditor.ProxyResponder; + set => this.numericEditor.ProxyResponder = value; } public virtual void Reset () diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index 7f324cf..e5293d7 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -51,18 +51,18 @@ namespace Xamarin.PropertyEditing.Mac Delegate = keyUpDownDelegate; } - public ProxyRowResponder ResponderProxy + public RowProxyResponder ProxyResponder { get { if (Delegate is KeyUpDownDelegate keydown) { - return keydown.ResponderProxy; + return keydown.ProxyResponder; } return null; } set { if (Delegate is KeyUpDownDelegate keydown) { - keydown.ResponderProxy = value; + keydown.ProxyResponder = value; } } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index 230c42d..1ab1b64 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -8,19 +8,19 @@ namespace Xamarin.PropertyEditing.Mac { class TextNextResponderDelegate : NSTextFieldDelegate { - public ProxyRowResponder ResponderProxy { get; set; } + public RowProxyResponder ProxyResponder { get; set; } public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) { switch (commandSelector.Name) { case "insertTab:": - if (ResponderProxy?.NextResponder () ?? false) + if (ProxyResponder?.NextResponder () ?? false) { return true; } break; case "insertBacktab:": - if (ResponderProxy?.PreviousResponder () ?? false) + if (ProxyResponder?.PreviousResponder () ?? false) { return true; } @@ -88,7 +88,7 @@ namespace Xamarin.PropertyEditing.Mac { var propertyEditorDelegate = new EntryPropertyEditorDelegate (viewModel) { - ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; return propertyEditorDelegate; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index 2950ae2..7b34787 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -18,7 +18,7 @@ namespace Xamarin.PropertyEditing.Mac NumericEditor = new NumericSpinEditor (hostResources) { - ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; NumericEditor.ValueChanged += OnValueChanged; diff --git a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs index 0f7b056..1ca92ee 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs @@ -113,7 +113,7 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); @@ -156,7 +156,7 @@ namespace Xamarin.PropertyEditing.Mac LineBreakMode = NSLineBreakMode.TruncatingTail, UsesSingleLineMode = true, }, - ResponderProxy = new ProxyRowResponder (this, ProxyRowType.SingleView), + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, diff --git a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs index 6f0784e..78f9563 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs @@ -9,13 +9,13 @@ namespace Xamarin.PropertyEditing.Mac LastView } - internal class ProxyRowResponder + internal class RowProxyResponder { protected WeakReference editorControl; readonly ProxyRowType rowType; - public ProxyRowResponder (PropertyEditorControl editorControl, ProxyRowType rowType) + public RowProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType) { this.rowType = rowType; this.editorControl = new WeakReference (editorControl); diff --git a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs index 88ff2cb..872cce0 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs @@ -16,7 +16,7 @@ namespace Xamarin.PropertyEditing.Mac base.TranslatesAutoresizingMaskIntoConstraints = false; this.ratioEditor = new RatioEditor (hostResources); - this.ratioEditor.ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView); + this.ratioEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); this.ratioEditor.SetFormatter (null); // update the value on keypress diff --git a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs index 4c60dfc..4755e15 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs @@ -14,7 +14,7 @@ namespace Xamarin.PropertyEditing.Mac protected override EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { return new TimeSpanDelegate (viewModel) { - ResponderProxy = new ProxyRowResponder(this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; } -- cgit v1.2.3 From 834eaf62a7bf1cb6a89d423b3148b197cdca84ec Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Mon, 21 Feb 2022 14:49:18 +0100 Subject: Fixes NRE when viewmodel is not set --- Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs index 7899c8c..110b86c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs @@ -129,7 +129,7 @@ namespace Xamarin.PropertyEditing.Mac ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; } - if (ctrl != null && !ctrl.viewModel.IsInputEnabled) { + if (ctrl?.viewModel != null && !ctrl.viewModel.IsInputEnabled) { ctrl = null; } @@ -158,7 +158,7 @@ namespace Xamarin.PropertyEditing.Mac ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; } - if (ctrl != null && !ctrl.viewModel.IsInputEnabled) { + if (ctrl?.viewModel != null && !ctrl.viewModel.IsInputEnabled) { ctrl = null; } -- cgit v1.2.3 From bb6d3c9ed0ca2708021157f0de1cef73703abc1b Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Tue, 22 Feb 2022 16:41:28 +0100 Subject: Fixes break only when proxy is handled --- Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs | 3 ++- Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs index 0f30939..bf43bb5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs @@ -17,8 +17,9 @@ namespace Xamarin.PropertyEditing.Mac } else { ProxyResponder.NextResponder (); } + return; } - return; + break; } base.KeyDown (theEvent); } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs index a9994c7..af6bb82 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -17,8 +17,9 @@ namespace Xamarin.PropertyEditing.Mac } else { ProxyResponder.NextResponder (); } + return; } - return; + break; } base.KeyDown (theEvent); } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index fa00bcf..b436445 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -25,8 +25,9 @@ namespace Xamarin.PropertyEditing.Mac } else { ProxyResponder.NextResponder (); } + return; } - return; + break; } base.KeyDown (theEvent); } -- cgit v1.2.3 From 56c299b6d981979628ffd31ab4ea904ac5c4996f Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Tue, 22 Feb 2022 18:14:26 +0100 Subject: Moves ProxyResponder button to a new class --- .../Controls/Custom/FocusableBooleanButton.cs | 22 ------------------ .../Controls/Custom/ProxyResponderButton.cs | 26 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs index bf43bb5..8548985 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableBooleanButton.cs @@ -3,28 +3,6 @@ using AppKit; namespace Xamarin.PropertyEditing.Mac { - internal class ProxyResponderButton : NSButton - { - public RowProxyResponder ProxyResponder { get; set; } - - public override void KeyDown (NSEvent theEvent) - { - switch (theEvent.KeyCode) { - case (int)NSKey.Tab: - if (ProxyResponder != null) { - if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { - ProxyResponder.PreviousResponder (); - } else { - ProxyResponder.NextResponder (); - } - return; - } - break; - } - base.KeyDown (theEvent); - } - } - internal class FocusableBooleanButton : ProxyResponderButton { public override bool CanBecomeKeyView { get { return Enabled; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs new file mode 100644 index 0000000..8182fbb --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs @@ -0,0 +1,26 @@ +using AppKit; + +namespace Xamarin.PropertyEditing.Mac +{ + internal class ProxyResponderButton : NSButton + { + public RowProxyResponder ProxyResponder { get; set; } + + public override void KeyDown (NSEvent theEvent) + { + switch (theEvent.KeyCode) { + case (int)NSKey.Tab: + if (ProxyResponder != null) { + if (theEvent.ModifierFlags.HasFlag(NSEventModifierMask.ShiftKeyMask)) { + ProxyResponder.PreviousResponder (); + } else { + ProxyResponder.NextResponder (); + } + return; + } + break; + } + base.KeyDown (theEvent); + } + } +} -- cgit v1.2.3 From a86acaadaafd74105738862447953df0d9a1f16c Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Tue, 22 Feb 2022 18:16:37 +0100 Subject: Fixes typo --- Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs index d1465cc..12235ca 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs @@ -25,11 +25,11 @@ namespace Xamarin.PropertyEditing.Mac private readonly TextNextResponderDelegate textNextResponderDelegate; - class BasePathEditordDelegate : TextNextResponderDelegate + class BasePathEditorDelegate : TextNextResponderDelegate { WeakReference> weakView; - public BasePathEditordDelegate (BasePathEditorControl basePathEditorControl) + public BasePathEditorDelegate (BasePathEditorControl basePathEditorControl) { weakView = new WeakReference>(basePathEditorControl); } @@ -47,7 +47,7 @@ namespace Xamarin.PropertyEditing.Mac { this.currentTextField = new TextFieldSmallButtonContainer (); - this.textNextResponderDelegate = new BasePathEditordDelegate (this) + this.textNextResponderDelegate = new BasePathEditorDelegate (this) { ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; -- cgit v1.2.3 From 2ca0edb87fb052380e1730301eaa3199aea7ddda Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Thu, 24 Feb 2022 10:48:56 +0100 Subject: Refactoring in OnPreviousResponderRequested and OnNextResponderRequested --- .../Controls/PropertyEditorControl.cs | 41 +++++----------------- .../Controls/ProxyRowResponder.cs | 4 +-- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs index 110b86c..f8448ec 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs @@ -113,44 +113,18 @@ namespace Xamarin.PropertyEditing.Mac AppearanceChanged (); } - public void OnNextResponderRequested () + public void OnNextResponderRequested (bool reverse) { if (TableView != null) { - nint row = TableView.RowForView (this) + 1; + var modifier = reverse ? -1 : 1; - NSView view; - PropertyEditorControl ctrl = null; - - for (; row < TableView.RowCount; row++) { - view = TableView.GetView (0, row, makeIfNecessary: false); - if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer - ctrl = pec; - } else { - ctrl = (view as EditorContainer)?.EditorView?.NativeView as PropertyEditorControl; - } - - if (ctrl?.viewModel != null && !ctrl.viewModel.IsInputEnabled) { - ctrl = null; - } - - if (ctrl != null) { - Window?.MakeFirstResponder (ctrl.FirstKeyView); - return; - } - } - } - } - - public void OnPreviousResponderRequested () - { - if (TableView != null) { - nint row = TableView.RowForView (this) - 1; + nint row = TableView.RowForView (this) + modifier; NSView view; PropertyEditorControl ctrl = null; - for (; row > 0; row--) - { + for (; reverse ? row > 0 : row < TableView.RowCount; row += modifier) { + view = TableView.GetView (0, row, makeIfNecessary: false); if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer ctrl = pec; @@ -163,10 +137,11 @@ namespace Xamarin.PropertyEditing.Mac } if (ctrl != null) { - Window?.MakeFirstResponder (ctrl.LastKeyView); + var targetView = reverse ? ctrl.LastKeyView : ctrl.FirstKeyView; + Window?.MakeFirstResponder (targetView); return; } else if (row == 0 && view is PanelHeaderEditorControl header) { - Window?.MakeFirstResponder(header); + Window?.MakeFirstResponder (header); return; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs index 78f9563..ca613d1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs @@ -26,7 +26,7 @@ namespace Xamarin.PropertyEditing.Mac if (this.editorControl.TryGetTarget (out var editor)) { if (this.rowType == ProxyRowType.LastView || this.rowType == ProxyRowType.SingleView) { - editor.OnNextResponderRequested (); + editor.OnNextResponderRequested (false); return true; } } @@ -38,7 +38,7 @@ namespace Xamarin.PropertyEditing.Mac if (this.editorControl.TryGetTarget (out var editor)) { if (this.rowType == ProxyRowType.FirstView || this.rowType == ProxyRowType.SingleView) { - editor.OnPreviousResponderRequested (); + editor.OnNextResponderRequested (true); return true; } } -- cgit v1.2.3 From b3b7d78f92cdf1c3dc5f85cfb8e0415595fe7343 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 05:55:23 +0100 Subject: Adds some missing ProxyResponders --- .../Controls/CombinablePropertyEditor.cs | 17 +++++++++++++++-- .../Controls/EntryPropertyEditor.cs | 7 ++++++- .../Controls/NumericEditorControl.cs | 5 ++++- .../Controls/PredefinedValuesEditor.cs | 8 ++++---- .../Controls/StringEditorControl.cs | 4 ++-- .../Controls/TypeEditorControl.cs | 4 +++- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs index 5122f24..7aeaaf3 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs @@ -83,8 +83,21 @@ namespace Xamarin.PropertyEditing.Mac } // Set our tabable order - this.firstKeyView = this.combinableList.KeyAt (0); - this.lastKeyView = this.combinableList.KeyAt (this.combinableList.Count - 1); + var firstButton = (FocusableBooleanButton) this.combinableList.KeyAt (0); + this.firstKeyView = firstButton; + + var lastButton = (FocusableBooleanButton)this.combinableList.KeyAt (this.combinableList.Count - 1); + this.lastKeyView = lastButton; + + if (combinableList.Count > 0) + { + if (firstButton == lastButton) { + firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + } else { + firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + lastButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + } + } SetEnabled (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index 1ab1b64..1017d99 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -44,6 +44,11 @@ namespace Xamarin.PropertyEditing.Mac }; AddSubview (Entry); + Entry.Delegate = new TextNextResponderDelegate () + { + ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) + }; + RightEdgeConstraint = NSLayoutConstraint.Create (Entry, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, 0); AddConstraints (new[] { NSLayoutConstraint.Create (Entry, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1f, 0), @@ -88,7 +93,7 @@ namespace Xamarin.PropertyEditing.Mac { var propertyEditorDelegate = new EntryPropertyEditorDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; return propertyEditorDelegate; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index 7b34787..4687e0c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -132,6 +132,9 @@ namespace Xamarin.PropertyEditing.Mac TranslatesAutoresizingMaskIntoConstraints = false, }; + this.NumericEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; ViewModel.InputMode = this.viewModelInputModes.FirstOrDefault (im => im.Identifier == popupButton.Title); @@ -166,7 +169,7 @@ namespace Xamarin.PropertyEditing.Mac private Type underlyingType; - internal NSPopUpButton inputModePopup; + internal FocusablePopUpButton inputModePopup; private IReadOnlyList viewModelInputModes; private readonly NSLayoutConstraint editorRightConstraint; diff --git a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs index 1ca92ee..ae3d307 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs @@ -74,8 +74,8 @@ namespace Xamarin.PropertyEditing.Mac } } - private NSComboBox comboBox; - private NSPopUpButton popupButton; + private FocusableComboBox comboBox; + private FocusablePopUpButton popupButton; private NSMenu popupButtonList; private NSView firstKeyView; @@ -115,7 +115,7 @@ namespace Xamarin.PropertyEditing.Mac StringValue = String.Empty, ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) }; - + this.popupButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); this.popupButtonList = new NSMenu (); this.popupButton.Menu = this.popupButtonList; this.popupButton.Activated += PopupButton_Activated; @@ -162,7 +162,7 @@ namespace Xamarin.PropertyEditing.Mac TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, }; - + this.comboBox.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); this.comboBox.SelectionChanged += ComboBox_SelectionChanged; AddSubview (this.comboBox); diff --git a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs index e10ec78..80ff123 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs @@ -45,7 +45,7 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false }; - + this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; ViewModel.InputMode = this.viewModelInputModes.FirstOrDefault (im => im.Identifier == popupButton.Title); @@ -104,7 +104,7 @@ namespace Xamarin.PropertyEditing.Mac private NSView lastKeyView; private NSLayoutConstraint editorInputModeConstraint; - private NSPopUpButton inputModePopup; + private FocusablePopUpButton inputModePopup; private IReadOnlyList viewModelInputModes; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs index 9ee86d1..381244a 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs @@ -22,7 +22,9 @@ namespace Xamarin.PropertyEditing.Mac this.selectType = new FocusableButton { BezelStyle = NSBezelStyle.Rounded, Title = Properties.Resources.Select, + ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) }; + this.selectType.Activated += OnSelectPressed; AddSubview (this.selectType); @@ -89,7 +91,7 @@ namespace Xamarin.PropertyEditing.Mac } private readonly UnfocusableTextField typeLabel; - private readonly NSButton selectType; + private readonly FocusableButton selectType; private void OnTypeRequested (object sender, TypeRequestedEventArgs e) { -- cgit v1.2.3 From d3db565b22ca5f0e2ac24a4d149715fd89d13a1b Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 06:01:42 +0100 Subject: Breaks DoCommandBySelector when TextNextResponderDelegate handles --- .../Controls/Custom/NumericTextField.cs | 38 ++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index e5293d7..75e0a08 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -179,24 +179,28 @@ namespace Xamarin.PropertyEditing.Mac public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) { - if (!base.DoCommandBySelector(control, textView, commandSelector)) + //if parent already handles command we break the event chain + var parentHandlesCommand = base.DoCommandBySelector (control, textView, commandSelector); + if (parentHandlesCommand) { - switch (commandSelector.Name) { - case "moveUp:": - OnKeyArrowUp (); - break; - case "moveDown:": - OnKeyArrowDown (); - break; - case "moveUpAndModifySelection:": - OnKeyArrowUp (true); - break; - case "moveDownAndModifySelection:": - OnKeyArrowDown (true); - break; - default: - return false; - } + return false; + } + + switch (commandSelector.Name) { + case "moveUp:": + OnKeyArrowUp (); + break; + case "moveDown:": + OnKeyArrowDown (); + break; + case "moveUpAndModifySelection:": + OnKeyArrowUp (true); + break; + case "moveDownAndModifySelection:": + OnKeyArrowDown (true); + break; + default: + return false; } return true; -- cgit v1.2.3 From 5bbe8d577617b6f6f0eaac3f06aebfba1a4553b0 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 06:15:16 +0100 Subject: Renames RowProxyResponder to ProxyResponder --- .../Controls/BasePathEditorControl.cs | 6 ++-- .../Controls/BasePointEditorControl.cs | 4 +-- .../Controls/BaseRectangleEditorControl.cs | 4 +-- .../Controls/BooleanEditorControl.cs | 2 +- .../Controls/BrushEditorControl.cs | 2 +- .../Controls/CharEditorControl.cs | 2 +- .../Controls/CollectionInlineEditorControl.cs | 2 +- .../Controls/CombinablePropertyEditor.cs | 6 ++-- .../Controls/Custom/FocusableComboBox.cs | 2 +- .../Controls/Custom/FocusablePopupButton.cs | 2 +- .../Controls/Custom/NumericSpinEditor.cs | 2 +- .../Controls/Custom/NumericTextField.cs | 4 +-- .../Controls/Custom/ProxyResponderButton.cs | 2 +- .../Controls/EntryPropertyEditor.cs | 39 +++++++++++----------- .../Controls/NumericEditorControl.cs | 6 ++-- .../Controls/PredefinedValuesEditor.cs | 8 ++--- .../Controls/ProxyRowResponder.cs | 4 +-- .../Controls/RatioEditorControl.cs | 2 +- .../Controls/StringEditorControl.cs | 2 +- .../Controls/TimeSpanEditorControl.cs | 2 +- .../Controls/TypeEditorControl.cs | 2 +- 21 files changed, 53 insertions(+), 52 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs index 12235ca..f7f0d39 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePathEditorControl.cs @@ -23,9 +23,9 @@ namespace Xamarin.PropertyEditing.Mac private readonly NSObject[] objects; public override NSObject[] AccessibilityChildren { get => this.objects; } - private readonly TextNextResponderDelegate textNextResponderDelegate; + private readonly DelegatedRowTextFieldDelegate textNextResponderDelegate; - class BasePathEditorDelegate : TextNextResponderDelegate + class BasePathEditorDelegate : DelegatedRowTextFieldDelegate { WeakReference> weakView; @@ -49,7 +49,7 @@ namespace Xamarin.PropertyEditing.Mac this.textNextResponderDelegate = new BasePathEditorDelegate (this) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; this.currentTextField.Delegate = this.textNextResponderDelegate; AddSubview (this.currentTextField); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs index 7300ed1..7193566 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BasePointEditorControl.cs @@ -28,7 +28,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -40,7 +40,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - YEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + YEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); YEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs index 8e426ee..68406a1 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs @@ -33,7 +33,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - XEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); + XEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); XEditor.ValueChanged += OnInputUpdated; YLabel = new UnfocusableTextField { @@ -64,7 +64,7 @@ namespace Xamarin.PropertyEditing.Mac BackgroundColor = NSColor.Clear, Value = 0.0f }; - HeightEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + HeightEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); HeightEditor.ValueChanged += OnInputUpdated; AddSubview (XLabel); diff --git a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs index a6196f2..b6c1ca5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BooleanEditorControl.cs @@ -13,7 +13,7 @@ namespace Xamarin.PropertyEditing.Mac { BooleanEditor = new FocusableBooleanButton () { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; BooleanEditor.Title = string.Empty; diff --git a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs index c8413ec..799a91d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/BrushEditorControl.cs @@ -56,7 +56,7 @@ namespace Xamarin.PropertyEditing.Mac ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; this.popupButtonList = new NSMenu (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs index f6b22ff..e1eb1b6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CharEditorControl.cs @@ -15,7 +15,7 @@ namespace Xamarin.PropertyEditing.Mac { var charDelegate = new CharDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; return charDelegate; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs index 0c839a3..0bdcabb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CollectionInlineEditorControl.cs @@ -24,7 +24,7 @@ namespace Xamarin.PropertyEditing.Mac Title = Properties.Resources.CollectionEditButton, BezelStyle = NSBezelStyle.Rounded, AccessibilityEnabled = true, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView), AccessibilityHelp = Properties.Resources.AccessibilityCollectionHelp }; diff --git a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs index 7aeaaf3..c2ce8a5 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/CombinablePropertyEditor.cs @@ -92,10 +92,10 @@ namespace Xamarin.PropertyEditing.Mac if (combinableList.Count > 0) { if (firstButton == lastButton) { - firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + firstButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); } else { - firstButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); - lastButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + firstButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); + lastButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs index af6bb82..b1f5eaa 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusableComboBox.cs @@ -5,7 +5,7 @@ namespace Xamarin.PropertyEditing.Mac { internal class FocusableComboBox : NSComboBox { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs index b436445..7d1bc6c 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/FocusablePopupButton.cs @@ -8,7 +8,7 @@ namespace Xamarin.PropertyEditing.Mac { public override bool CanBecomeKeyView { get { return Enabled; } } - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public FocusablePopUpButton () { diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs index d7d5253..9da66b9 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericSpinEditor.cs @@ -172,7 +172,7 @@ namespace Xamarin.PropertyEditing.Mac set { this.numericEditor.AccessibilityTitle = value; } } - public RowProxyResponder ProxyResponder + public ProxyResponder ProxyResponder { get => this.numericEditor.ProxyResponder; set => this.numericEditor.ProxyResponder = value; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index 75e0a08..1043286 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -51,7 +51,7 @@ namespace Xamarin.PropertyEditing.Mac Delegate = keyUpDownDelegate; } - public RowProxyResponder ProxyResponder + public ProxyResponder ProxyResponder { get { if (Delegate is KeyUpDownDelegate keydown) { @@ -172,7 +172,7 @@ namespace Xamarin.PropertyEditing.Mac } } - internal class KeyUpDownDelegate : TextNextResponderDelegate + internal class KeyUpDownDelegate : DelegatedRowTextFieldDelegate { public event EventHandler KeyArrowUp; public event EventHandler KeyArrowDown; diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs index 8182fbb..a37479f 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/ProxyResponderButton.cs @@ -4,7 +4,7 @@ namespace Xamarin.PropertyEditing.Mac { internal class ProxyResponderButton : NSButton { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override void KeyDown (NSEvent theEvent) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs index 1017d99..d6d7e1d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/EntryPropertyEditor.cs @@ -6,26 +6,27 @@ using ObjCRuntime; namespace Xamarin.PropertyEditing.Mac { - class TextNextResponderDelegate : NSTextFieldDelegate + class DelegatedRowTextFieldDelegate : NSTextFieldDelegate { - public RowProxyResponder ProxyResponder { get; set; } + public ProxyResponder ProxyResponder { get; set; } public override bool DoCommandBySelector (NSControl control, NSTextView textView, Selector commandSelector) { - switch (commandSelector.Name) { - case "insertTab:": - if (ProxyResponder?.NextResponder () ?? false) - { - return true; - } - break; - case "insertBacktab:": - if (ProxyResponder?.PreviousResponder () ?? false) - { - return true; + if (ProxyResponder != null) + { + switch (commandSelector.Name) { + case "insertTab:": + if (ProxyResponder.NextResponder ()) { + return true; + } + break; + case "insertBacktab:": + if (ProxyResponder.PreviousResponder ()) { + return true; + } + break; } - break; - } + } return false; } } @@ -44,9 +45,9 @@ namespace Xamarin.PropertyEditing.Mac }; AddSubview (Entry); - Entry.Delegate = new TextNextResponderDelegate () + Entry.Delegate = new DelegatedRowTextFieldDelegate () { - ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder(this, ProxyRowType.SingleView) }; RightEdgeConstraint = NSLayoutConstraint.Create (Entry, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this, NSLayoutAttribute.Right, 1f, 0); @@ -93,7 +94,7 @@ namespace Xamarin.PropertyEditing.Mac { var propertyEditorDelegate = new EntryPropertyEditorDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; return propertyEditorDelegate; } @@ -105,7 +106,7 @@ namespace Xamarin.PropertyEditing.Mac } internal class EntryPropertyEditorDelegate - : TextNextResponderDelegate + : DelegatedRowTextFieldDelegate { public EntryPropertyEditorDelegate (PropertyViewModel viewModel) { diff --git a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs index 4687e0c..3a00b28 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/NumericEditorControl.cs @@ -18,7 +18,7 @@ namespace Xamarin.PropertyEditing.Mac NumericEditor = new NumericSpinEditor (hostResources) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; NumericEditor.ValueChanged += OnValueChanged; @@ -132,8 +132,8 @@ namespace Xamarin.PropertyEditing.Mac TranslatesAutoresizingMaskIntoConstraints = false, }; - this.NumericEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.FirstView); - this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.LastView); + this.NumericEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.FirstView); + this.inputModePopup.ProxyResponder = new ProxyResponder (this, ProxyRowType.LastView); this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; diff --git a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs index ae3d307..77f6edb 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PredefinedValuesEditor.cs @@ -113,9 +113,9 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; - this.popupButton.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.popupButton.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.popupButtonList = new NSMenu (); this.popupButton.Menu = this.popupButtonList; this.popupButton.Activated += PopupButton_Activated; @@ -156,13 +156,13 @@ namespace Xamarin.PropertyEditing.Mac LineBreakMode = NSLineBreakMode.TruncatingTail, UsesSingleLineMode = true, }, - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView), + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView), ControlSize = NSControlSize.Small, Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false, StringValue = String.Empty, }; - this.comboBox.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.comboBox.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.comboBox.SelectionChanged += ComboBox_SelectionChanged; AddSubview (this.comboBox); diff --git a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs index ca613d1..406bde4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/ProxyRowResponder.cs @@ -9,13 +9,13 @@ namespace Xamarin.PropertyEditing.Mac LastView } - internal class RowProxyResponder + internal class ProxyResponder { protected WeakReference editorControl; readonly ProxyRowType rowType; - public RowProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType) + public ProxyResponder (PropertyEditorControl editorControl, ProxyRowType rowType) { this.rowType = rowType; this.editorControl = new WeakReference (editorControl); diff --git a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs index 872cce0..a5c8fdc 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RatioEditorControl.cs @@ -16,7 +16,7 @@ namespace Xamarin.PropertyEditing.Mac base.TranslatesAutoresizingMaskIntoConstraints = false; this.ratioEditor = new RatioEditor (hostResources); - this.ratioEditor.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.ratioEditor.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.ratioEditor.SetFormatter (null); // update the value on keypress diff --git a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs index 80ff123..01a4af4 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/StringEditorControl.cs @@ -45,7 +45,7 @@ namespace Xamarin.PropertyEditing.Mac Font = NSFont.SystemFontOfSize (NSFont.SystemFontSizeForControlSize (NSControlSize.Small)), TranslatesAutoresizingMaskIntoConstraints = false }; - this.inputModePopup.ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView); + this.inputModePopup.ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView); this.inputModePopup.Activated += (o, e) => { var popupButton = o as NSPopUpButton; ViewModel.InputMode = this.viewModelInputModes.FirstOrDefault (im => im.Identifier == popupButton.Title); diff --git a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs index 4755e15..d6c6361 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TimeSpanEditorControl.cs @@ -14,7 +14,7 @@ namespace Xamarin.PropertyEditing.Mac protected override EntryPropertyEditorDelegate CreateDelegate (PropertyViewModel viewModel) { return new TimeSpanDelegate (viewModel) { - ProxyResponder = new RowProxyResponder (this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder (this, ProxyRowType.SingleView) }; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs index 381244a..0baee02 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/TypeEditorControl.cs @@ -22,7 +22,7 @@ namespace Xamarin.PropertyEditing.Mac this.selectType = new FocusableButton { BezelStyle = NSBezelStyle.Rounded, Title = Properties.Resources.Select, - ProxyResponder = new RowProxyResponder(this, ProxyRowType.SingleView) + ProxyResponder = new ProxyResponder(this, ProxyRowType.SingleView) }; this.selectType.Activated += OnSelectPressed; -- cgit v1.2.3 From ffe26ce676092e8cdc17505c48e17c07758bf1b2 Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 06:26:47 +0100 Subject: Caches RowCount into variable to avoid unnecessary native calls on each iteration --- Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs index f8448ec..0f2cec0 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/PropertyEditorControl.cs @@ -123,7 +123,8 @@ namespace Xamarin.PropertyEditing.Mac NSView view; PropertyEditorControl ctrl = null; - for (; reverse ? row > 0 : row < TableView.RowCount; row += modifier) { + var rowCount = TableView.RowCount; + for (; reverse ? row > 0 : row < rowCount; row += modifier) { view = TableView.GetView (0, row, makeIfNecessary: false); if (view is PropertyEditorControl pec) { // This is to include the CategoryContainer -- cgit v1.2.3 From 2ca79fd2bc386f01aacbe81119475c540863cb3e Mon Sep 17 00:00:00 2001 From: Jose Medrano Date: Fri, 25 Feb 2022 13:02:14 +0100 Subject: Fix comment --- Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs index 1043286..9e00331 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/NumericTextField.cs @@ -54,10 +54,7 @@ namespace Xamarin.PropertyEditing.Mac public ProxyResponder ProxyResponder { get { - if (Delegate is KeyUpDownDelegate keydown) { - return keydown.ProxyResponder; - } - return null; + return Delegate is KeyUpDownDelegate viewDownDelegate ? viewDownDelegate.ProxyResponder : null; } set { -- cgit v1.2.3