Skip to content

Commit

Permalink
Fixed issue with multiple classes not being marked with the attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaeler committed Oct 27, 2021
1 parent 7c3c3f5 commit e5b8386
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/ConsoleTest/FakeViewModel2.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using OuterNs.InnerNs;

using SpeedyGenerators;

namespace ConsoleTest_Extra
Expand All @@ -12,5 +15,17 @@ internal partial class FakeViewModel
{
[MakeProperty("X")]
private int _x;

[MakeProperty("Y")]
private ObservableCollection<SomeType> _y;
}
}


namespace OuterNs
{
namespace InnerNs
{
public record SomeType(int A);
}
}
2 changes: 1 addition & 1 deletion src/SpeedyGenerators/PropertyChangedGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void Execute(GeneratorExecutionContext context)
var namespaceName = fieldInfos.FirstOrDefault()?.NamespaceName;

if (className == null) return;
if (!fieldInfos.Any(f => f.AttributeArguments != null)) return;
if (!fieldInfos.Any(f => f.AttributeArguments != null)) continue;

var mgr = new GeneratorManager();
var result = mgr.GenerateINPCClass(namespaceName, className, fieldInfos);
Expand Down

0 comments on commit e5b8386

Please sign in to comment.