From 8d1a8e014bf13ec5f77dfd0180d9cb19ad7ea790 Mon Sep 17 00:00:00 2001 From: Adolfo Marinucci Date: Tue, 10 Dec 2024 19:24:39 +0100 Subject: [PATCH] 2.0.59 - Fixed an issue with scaffold generator, see https://github.com/adospace/mauireactor-integration/issues/4 --- .github/workflows/build-deploy.yml | 2 +- .../Properties/launchSettings.json | 2 +- .../ScaffoldTypeGenerator.partial.cs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index b84ab11..0ec96f9 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -16,7 +16,7 @@ jobs: Solution_Name: ./src/MauiReactor.Build.sln Test_Project: ./samples/UnitTests/UnitTests.csproj TemplatePack_Name: ./src/MauiReactor.TemplatePack/MauiReactor.TemplatePack.csproj - Version: 2.0.58 + Version: 2.0.59 steps: - name: Checkout diff --git a/src/MauiReactor.ScaffoldGenerator/Properties/launchSettings.json b/src/MauiReactor.ScaffoldGenerator/Properties/launchSettings.json index 8141141..26683b5 100644 --- a/src/MauiReactor.ScaffoldGenerator/Properties/launchSettings.json +++ b/src/MauiReactor.ScaffoldGenerator/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Profile 1": { "commandName": "DebugRoslynComponent", - "targetProject": "..\\..\\samples\\ChartApp\\ChartApp.csproj" + "targetProject": "..\\..\\..\\mauireactor-integration\\DevExpress\\DevExpressIntApp\\DevExpressIntApp.csproj" } } } \ No newline at end of file diff --git a/src/MauiReactor.ScaffoldGenerator/ScaffoldTypeGenerator.partial.cs b/src/MauiReactor.ScaffoldGenerator/ScaffoldTypeGenerator.partial.cs index bac03eb..bd1c429 100644 --- a/src/MauiReactor.ScaffoldGenerator/ScaffoldTypeGenerator.partial.cs +++ b/src/MauiReactor.ScaffoldGenerator/ScaffoldTypeGenerator.partial.cs @@ -30,7 +30,7 @@ public ScaffoldTypeGenerator( .Cast() .Where(_ => !_.IsReadOnly && !_.IsWriteOnly) .Where(_ => (_.ContainingType is INamedTypeSymbol namedTypeSymbol) && namedTypeSymbol.GetFullyQualifiedName() == typeToScaffold.GetFullyQualifiedName()) - //.Where(_ => !((INamedTypeSymbol)_.Type).IsGenericType) + .Where(_ => _.DeclaredAccessibility == Accessibility.Public) // Check if the property is public .GroupBy(p => p.Name, StringComparer.OrdinalIgnoreCase) .ToDictionary(g => g.Key, g => g.First(), StringComparer.OrdinalIgnoreCase); @@ -39,6 +39,7 @@ public ScaffoldTypeGenerator( .Where(_ => _.Kind == SymbolKind.Field) .Cast() .Where(_ => _.Type.Equals(bindablePropertyType, SymbolEqualityComparer.Default)) + .Where(_ => _.DeclaredAccessibility == Accessibility.Public) // Check if the field is public .Select(_ => _.Name.Substring(0, _.Name.Length - "Property".Length)) .Where(_ => propertiesMap.ContainsKey(_)) .Select(_ => propertiesMap[_]) @@ -71,6 +72,7 @@ public ScaffoldTypeGenerator( Events = typeToScaffold.GetMembers() .Where(_ => _.Kind == SymbolKind.Event) .Cast() + .Where(_ => _.DeclaredAccessibility == Accessibility.Public) // Check if the field is public .Where(_ => _.Type.Name != "Func") .Where(_ => !_.Name.Contains('.')) .Where(_ => (_.ContainingType is INamedTypeSymbol namedTypeSymbol) && namedTypeSymbol.GetFullyQualifiedName() == typeToScaffold.GetFullyQualifiedName())