Skip to content

Commit 783e552

Browse files
Reverted new constructors for BindablePropertyAttributes. Was causing issues in source generator
1 parent 55309a1 commit 783e552

File tree

1 file changed

+8
-51
lines changed

1 file changed

+8
-51
lines changed

src/ThunderDesign.Net-PCL.Threading.Shared/Attributes/BindablePropertyAttribute.cs

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,68 +9,25 @@ namespace ThunderDesign.Net.Threading.Attributes
99
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
1010
public sealed class BindablePropertyAttribute : Attribute
1111
{
12-
public bool ReadOnly { get; private set; }
13-
public bool ThreadSafe { get; private set; }
14-
public bool Notify { get; private set; }
15-
public string[] AlsoNotify { get; private set; }
16-
public AccessorAccessibility Getter { get; private set; }
17-
public AccessorAccessibility Setter { get; private set; }
12+
public bool ReadOnly { get; }
13+
public bool ThreadSafe { get; }
14+
public bool Notify { get; }
15+
public string[] AlsoNotify { get; }
16+
public AccessorAccessibility Getter { get; }
17+
public AccessorAccessibility Setter { get; }
1818

1919
public BindablePropertyAttribute(
2020
bool readOnly = false,
2121
bool threadSafe = true,
2222
bool notify = true,
23+
string[] alsoNotify = null,
2324
AccessorAccessibility getter = AccessorAccessibility.Public,
2425
AccessorAccessibility setter = AccessorAccessibility.Public)
25-
{
26-
ApplyBindablePropertyAttribute(Array.Empty<string>(), readOnly, threadSafe, notify, getter, setter);
27-
}
28-
29-
public BindablePropertyAttribute(
30-
string alsoNotify,
31-
bool readOnly = false,
32-
bool threadSafe = true,
33-
bool notify = true,
34-
AccessorAccessibility getter = AccessorAccessibility.Public,
35-
AccessorAccessibility setter = AccessorAccessibility.Public)
36-
{
37-
ApplyBindablePropertyAttribute(string.IsNullOrEmpty(alsoNotify) ? Array.Empty<string>() : new string[1] { alsoNotify }, readOnly, threadSafe, notify, getter, setter);
38-
}
39-
40-
public BindablePropertyAttribute(
41-
string[] alsoNotify,
42-
bool readOnly = false,
43-
bool threadSafe = true,
44-
bool notify = true,
45-
AccessorAccessibility getter = AccessorAccessibility.Public,
46-
AccessorAccessibility setter = AccessorAccessibility.Public)
47-
{
48-
ApplyBindablePropertyAttribute(alsoNotify ?? Array.Empty<string>(), readOnly, threadSafe, notify, getter, setter);
49-
}
50-
51-
public BindablePropertyAttribute(
52-
IEnumerable<string> alsoNotify,
53-
bool readOnly = false,
54-
bool threadSafe = true,
55-
AccessorAccessibility getter = AccessorAccessibility.Public,
56-
AccessorAccessibility setter = AccessorAccessibility.Public,
57-
bool notify = true)
58-
{
59-
ApplyBindablePropertyAttribute(alsoNotify?.ToArray() ?? Array.Empty<string>(), readOnly, threadSafe, notify, getter, setter);
60-
}
61-
62-
private void ApplyBindablePropertyAttribute(
63-
string[] alsoNotify,
64-
bool readOnly,
65-
bool threadSafe,
66-
bool notify,
67-
AccessorAccessibility getter,
68-
AccessorAccessibility setter)
6926
{
7027
ReadOnly = readOnly;
7128
ThreadSafe = threadSafe;
7229
Notify = notify;
73-
AlsoNotify = alsoNotify;
30+
AlsoNotify = alsoNotify ?? Array.Empty<string>();
7431
Getter = getter;
7532
Setter = setter;
7633
}

0 commit comments

Comments
 (0)