|
9 | 9 | using Splat; |
10 | 10 | using System.Collections.Generic; |
11 | 11 |
|
12 | | -namespace ReactiveUI { |
13 | | - |
14 | | - public interface IReactiveObjectExtension : IEnableLogger { |
| 12 | +namespace ReactiveUI |
| 13 | +{ |
| 14 | + public interface IReactiveObjectExtension : IEnableLogger |
| 15 | + { |
15 | 16 | event PropertyChangingEventHandler PropertyChanging; |
16 | 17 | event PropertyChangedEventHandler PropertyChanged; |
17 | 18 |
|
18 | 19 | void RaisePropertyChanging(PropertyChangingEventArgs args); |
19 | 20 | void RaisePropertyChanged(PropertyChangedEventArgs args); |
20 | 21 | } |
21 | 22 |
|
22 | | - public static class IReactiveExtensionExtensions { |
| 23 | + public static class IReactiveExtensionExtensions |
| 24 | + { |
23 | 25 | static ConditionalWeakTable<IReactiveObjectExtension, ExtensionState> state = new ConditionalWeakTable<IReactiveObjectExtension, ExtensionState>(); |
24 | 26 |
|
25 | 27 | internal static void setupReactiveExtension(this IReactiveObjectExtension This) { |
@@ -88,7 +90,8 @@ internal static void raisePropertyChanged(this IReactiveObjectExtension This, st |
88 | 90 | }, s.ChangedSubject); |
89 | 91 | } |
90 | 92 |
|
91 | | - internal static bool areChangeNotificationsEnabled(this IReactiveObjectExtension This) { |
| 93 | + internal static bool areChangeNotificationsEnabled(this IReactiveObjectExtension This) |
| 94 | + { |
92 | 95 | var s = state.GetOrCreateValue(This); |
93 | 96 |
|
94 | 97 | return (Interlocked.Read(ref s.ChangeNotificationsSuppressed) == 0); |
@@ -166,8 +169,10 @@ public static void RaisePropertyChanging(this IReactiveObjectExtension This, [Ca |
166 | 169 | This.raisePropertyChanging(propertyName); |
167 | 170 | } |
168 | 171 |
|
169 | | - class ExtensionState { |
170 | | - public ExtensionState() { |
| 172 | + class ExtensionState |
| 173 | + { |
| 174 | + public ExtensionState() |
| 175 | + { |
171 | 176 | ChangingSubject = new Subject<IObservedChange<object, object>>(); |
172 | 177 | ChangedSubject = new Subject<IObservedChange<object, object>>(); |
173 | 178 | ThrownExceptions = new ScheduledSubject<Exception>(Scheduler.Immediate, RxApp.DefaultExceptionHandler); |
|
0 commit comments