Skip to content

Commit

Permalink
Remove obsolete #if's. Remove VariadicTemplates for WP7.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaanstra committed Apr 2, 2013
1 parent 8b94898 commit 713978b
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 346 deletions.
8 changes: 0 additions & 8 deletions ReactiveUI/MakeObjectReactiveHelper.cs
Expand Up @@ -45,22 +45,14 @@ public IDisposable SuppressChangeNotifications()
new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler); new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler);


public IObservable<IObservedChange<object, object>> Changing { public IObservable<IObservedChange<object, object>> Changing {
#if SILVERLIGHT
get { return _Changing.Where(_ => _changeCountSuppressed == 0); }
#else
get { return _Changing.Where(_ => Interlocked.Read(ref _changeCountSuppressed) == 0); } get { return _Changing.Where(_ => Interlocked.Read(ref _changeCountSuppressed) == 0); }
#endif
} }


ISubject<IObservedChange<object, object>> _Changed = ISubject<IObservedChange<object, object>> _Changed =
new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler); new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler);


public IObservable<IObservedChange<object, object>> Changed { public IObservable<IObservedChange<object, object>> Changed {
#if SILVERLIGHT
get { return _Changed.Where(_ => _changeCountSuppressed == 0); }
#else
get { return _Changed.Where(_ => Interlocked.Read(ref _changeCountSuppressed) == 0); } get { return _Changed.Where(_ => Interlocked.Read(ref _changeCountSuppressed) == 0); }
#endif
} }
} }
} }
4 changes: 0 additions & 4 deletions ReactiveUI/ObservableAsyncMRUCache.cs
Expand Up @@ -203,11 +203,7 @@ internal class SemaphoreSubject<T> : ISubject<T>, IEnableLogger
public SemaphoreSubject(int maxCount, IScheduler sched = null) public SemaphoreSubject(int maxCount, IScheduler sched = null)
{ {
this.Log().Debug("maxCount is '{0}'", maxCount); this.Log().Debug("maxCount is '{0}'", maxCount);
#if WP7
_inner = new Subject<T>();
#else
_inner = (sched != null ? (ISubject<T>)new ScheduledSubject<T>(sched) : new Subject<T>()); _inner = (sched != null ? (ISubject<T>)new ScheduledSubject<T>(sched) : new Subject<T>());
#endif
_maxCount = maxCount; _maxCount = maxCount;
} }


Expand Down
3 changes: 0 additions & 3 deletions ReactiveUI/ReactiveCollection.cs
Expand Up @@ -63,9 +63,6 @@ public ReactiveCollection(IEnumerable<T> initialContents = null, IScheduler sche
} }


[OnDeserialized] [OnDeserialized]
#if WP7
public
#endif
void setupRx(StreamingContext _) { setupRx(); } void setupRx(StreamingContext _) { setupRx(); }


void setupRx(IEnumerable<T> initialContents = null, IScheduler scheduler = null, double resetChangeThreshold = 0.3) void setupRx(IEnumerable<T> initialContents = null, IScheduler scheduler = null, double resetChangeThreshold = 0.3)
Expand Down
13 changes: 2 additions & 11 deletions ReactiveUI/ReactiveObject.cs
Expand Up @@ -73,9 +73,6 @@ protected ReactiveObject()
} }


[OnDeserialized] [OnDeserialized]
#if WP7
public
#endif
void setupRxObj(StreamingContext sc) { setupRxObj(); } void setupRxObj(StreamingContext sc) { setupRxObj(); }


void setupRxObj() void setupRxObj()
Expand Down Expand Up @@ -168,14 +165,8 @@ void verifyPropertyName(string propertyName)
} }


protected bool areChangeNotificationsEnabled { protected bool areChangeNotificationsEnabled {
get { get {
#if SILVERLIGHT return (Interlocked.Read(ref changeNotificationsSuppressed) == 0);
// N.B. On most architectures, machine word aligned reads are
// guaranteed to be atomic - sorry WP7, you're out of luck
return changeNotificationsSuppressed == 0;
#else
return (Interlocked.Read(ref changeNotificationsSuppressed) == 0);
#endif
} }
} }


Expand Down
4 changes: 1 addition & 3 deletions ReactiveUI/RoutingState.cs
Expand Up @@ -60,10 +60,8 @@ public RoutingState()
} }


[OnDeserialized] [OnDeserialized]
#if WP7
public
#endif
void setupRx(StreamingContext sc) { setupRx(); } void setupRx(StreamingContext sc) { setupRx(); }

void setupRx() void setupRx()
{ {
if (rxObjectsSetup) return; if (rxObjectsSetup) return;
Expand Down
210 changes: 0 additions & 210 deletions ReactiveUI/VariadicTemplates_WP7.cs

This file was deleted.

0 comments on commit 713978b

Please sign in to comment.