11using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
24using ThunderDesign . Net . Threading . Enums ;
35
46namespace ThunderDesign . Net . Threading . Attributes
57{
68 [ AttributeUsage ( AttributeTargets . Field , Inherited = false , AllowMultiple = false ) ]
79 public sealed class BindablePropertyAttribute : Attribute
810 {
9- public bool ReadOnly { get ; }
10- public bool ThreadSafe { get ; }
11- public bool Notify { get ; }
12- public string [ ] AlsoNotify { get ; }
13- public AccessorAccessibility Getter { get ; }
14- public AccessorAccessibility Setter { get ; }
11+ public bool ReadOnly { get ; private set ; }
12+ public bool ThreadSafe { get ; private set ; }
13+ public bool Notify { get ; private set ; }
14+ public string [ ] AlsoNotify { get ; private set ; }
15+ public AccessorAccessibility Getter { get ; private set ; }
16+ public AccessorAccessibility Setter { get ; private set ; }
1517
1618 public BindablePropertyAttribute (
1719 bool readOnly = false ,
@@ -20,6 +22,39 @@ public BindablePropertyAttribute(
2022 string [ ] alsoNotify = null ,
2123 AccessorAccessibility getter = AccessorAccessibility . Public ,
2224 AccessorAccessibility setter = AccessorAccessibility . Public )
25+ {
26+ ApplyBindablePropertyAttribute ( readOnly , threadSafe , notify , alsoNotify ?? new string [ 0 ] , getter , setter ) ;
27+ }
28+
29+ public BindablePropertyAttribute (
30+ bool readOnly ,
31+ bool threadSafe ,
32+ bool notify ,
33+ IEnumerable < string > alsoNotify ,
34+ AccessorAccessibility getter = AccessorAccessibility . Public ,
35+ AccessorAccessibility setter = AccessorAccessibility . Public )
36+ {
37+ ApplyBindablePropertyAttribute ( readOnly , threadSafe , notify , alsoNotify ? . ToArray ( ) ?? new string [ 0 ] , getter , setter ) ;
38+ }
39+
40+ public BindablePropertyAttribute (
41+ bool readOnly ,
42+ bool threadSafe ,
43+ bool notify ,
44+ string alsoNotify ,
45+ AccessorAccessibility getter = AccessorAccessibility . Public ,
46+ AccessorAccessibility setter = AccessorAccessibility . Public )
47+ {
48+ ApplyBindablePropertyAttribute ( readOnly , threadSafe , notify , string . IsNullOrEmpty ( alsoNotify ) ? new string [ 0 ] : new string [ ] { alsoNotify } , getter , setter ) ;
49+ }
50+
51+ public void ApplyBindablePropertyAttribute (
52+ bool readOnly ,
53+ bool threadSafe ,
54+ bool notify ,
55+ string [ ] alsoNotify ,
56+ AccessorAccessibility getter ,
57+ AccessorAccessibility setter )
2358 {
2459 ReadOnly = readOnly ;
2560 ThreadSafe = threadSafe ;
0 commit comments