Skip to content

Commit 69419e7

Browse files
authored
Merge pull request #288 from CommunityToolkit/dev/revamp-attributes
Rename attributes, enable class-level support
2 parents a12f5f2 + 25a213b commit 69419e7

16 files changed

+874
-327
lines changed

CommunityToolkit.Mvvm.SourceGenerators/AnalyzerReleases.Shipped.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ MVVMTK0003 | CommunityToolkit.Mvvm.SourceGenerators.ObservableObjectGenerator |
1313
MVVMTK0004 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1414
MVVMTK0005 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1515
MVVMTK0006 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
16-
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
16+
MVVMTK0007 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
1717
MVVMTK0008 | Microsoft.CodeAnalysis.CSharp.CSharpParseOptions | Error | See https://aka.ms/mvvmtoolkit/error
18-
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
19-
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
20-
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
21-
MVVMTK0012 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
22-
MVVMTK0013 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
18+
MVVMTK0009 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
19+
MVVMTK0010 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
20+
MVVMTK0011 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
21+
MVVMTK0012 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
22+
MVVMTK0013 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2323
MVVMTK0014 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2424
MVVMTK0015 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
2525
MVVMTK0016 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
@@ -29,7 +29,11 @@ MVVMTK0019 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator
2929
MVVMTK0020 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3030
MVVMTK0021 | CommunityToolkit.Mvvm.SourceGenerators.ObservableRecipientGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3131
MVVMTK0022 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
32-
MVVMTK0023 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
33-
MVVMTK0024 | CommunityToolkit.Mvvm.SourceGenerators.ICommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
32+
MVVMTK0023 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
33+
MVVMTK0024 | CommunityToolkit.Mvvm.SourceGenerators.RelayCommandGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3434
MVVMTK0025 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
3535
MVVMTK0026 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
36+
MVVMTK0027 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
37+
MVVMTK0028 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Error | See https://aka.ms/mvvmtoolkit/error
38+
MVVMTK0029 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Warning | See https://aka.ms/mvvmtoolkit/error
39+
MVVMTK0030 | CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator | Warning | See https://aka.ms/mvvmtoolkit/error

CommunityToolkit.Mvvm.SourceGenerators/ComponentModel/Models/PropertyInfo.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace CommunityToolkit.Mvvm.SourceGenerators.ComponentModel.Models;
2020
/// <param name="PropertyChangingNames">The sequence of property changing properties to notify.</param>
2121
/// <param name="PropertyChangedNames">The sequence of property changed properties to notify.</param>
2222
/// <param name="NotifiedCommandNames">The sequence of commands to notify.</param>
23-
/// <param name="AlsoBroadcastChange">Whether or not the generated property also broadcasts changes.</param>
24-
/// <param name="AlsoValidateProperty">Whether or not the generated property also validates its value.</param>
23+
/// <param name="NotifyPropertyChangedRecipients">Whether or not the generated property also broadcasts changes.</param>
24+
/// <param name="NotifyDataErrorInfo">Whether or not the generated property also validates its value.</param>
2525
/// <param name="ForwardedAttributes">The sequence of forwarded attributes for the generated property.</param>
2626
internal sealed record PropertyInfo(
2727
string TypeNameWithNullabilityAnnotations,
@@ -30,8 +30,8 @@ internal sealed record PropertyInfo(
3030
ImmutableArray<string> PropertyChangingNames,
3131
ImmutableArray<string> PropertyChangedNames,
3232
ImmutableArray<string> NotifiedCommandNames,
33-
bool AlsoBroadcastChange,
34-
bool AlsoValidateProperty,
33+
bool NotifyPropertyChangedRecipients,
34+
bool NotifyDataErrorInfo,
3535
ImmutableArray<AttributeInfo> ForwardedAttributes)
3636
{
3737
/// <summary>
@@ -48,8 +48,8 @@ protected override void AddToHashCode(ref HashCode hashCode, PropertyInfo obj)
4848
hashCode.AddRange(obj.PropertyChangingNames);
4949
hashCode.AddRange(obj.PropertyChangedNames);
5050
hashCode.AddRange(obj.NotifiedCommandNames);
51-
hashCode.Add(obj.AlsoBroadcastChange);
52-
hashCode.Add(obj.AlsoValidateProperty);
51+
hashCode.Add(obj.NotifyPropertyChangedRecipients);
52+
hashCode.Add(obj.NotifyDataErrorInfo);
5353
hashCode.AddRange(obj.ForwardedAttributes, AttributeInfo.Comparer.Default);
5454
}
5555

@@ -63,8 +63,8 @@ protected override bool AreEqual(PropertyInfo x, PropertyInfo y)
6363
x.PropertyChangingNames.SequenceEqual(y.PropertyChangingNames) &&
6464
x.PropertyChangedNames.SequenceEqual(y.PropertyChangedNames) &&
6565
x.NotifiedCommandNames.SequenceEqual(y.NotifiedCommandNames) &&
66-
x.AlsoBroadcastChange == y.AlsoBroadcastChange &&
67-
x.AlsoValidateProperty == y.AlsoValidateProperty &&
66+
x.NotifyPropertyChangedRecipients == y.NotifyPropertyChangedRecipients &&
67+
x.NotifyDataErrorInfo == y.NotifyDataErrorInfo &&
6868
x.ForwardedAttributes.SequenceEqual(y.ForwardedAttributes, AttributeInfo.Comparer.Default);
6969
}
7070
}

0 commit comments

Comments
 (0)