Skip to content

Commit

Permalink
2.0.59 - Fixed an issue with scaffold generator, see adospace/mauirea…
Browse files Browse the repository at this point in the history
  • Loading branch information
adospace committed Dec 10, 2024
1 parent 5295d83 commit 8d1a8e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Profile 1": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\..\\samples\\ChartApp\\ChartApp.csproj"
"targetProject": "..\\..\\..\\mauireactor-integration\\DevExpress\\DevExpressIntApp\\DevExpressIntApp.csproj"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ScaffoldTypeGenerator(
.Cast<IPropertySymbol>()
.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);

Expand All @@ -39,6 +39,7 @@ public ScaffoldTypeGenerator(
.Where(_ => _.Kind == SymbolKind.Field)
.Cast<IFieldSymbol>()
.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[_])
Expand Down Expand Up @@ -71,6 +72,7 @@ public ScaffoldTypeGenerator(
Events = typeToScaffold.GetMembers()
.Where(_ => _.Kind == SymbolKind.Event)
.Cast<IEventSymbol>()
.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())
Expand Down

0 comments on commit 8d1a8e0

Please sign in to comment.