Oren Novotny 9 роки тому
батько
коміт
283bf5d254

+ 1 - 3
Rx.NET/Source/System.Reactive.Core/Reactive/Concurrency/Scheduler.Async.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if HAS_AWAIT
 using System.Reactive.Disposables;
 using System.Threading;
 using System.Threading.Tasks;
@@ -430,5 +429,4 @@ namespace System.Reactive.Concurrency
         }
 
     }
-}
-#endif
+}

+ 1 - 3
Rx.NET/Source/System.Reactive.Core/Reactive/Concurrency/SchedulerOperation.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if HAS_AWAIT
 using System.ComponentModel;
 using System.Runtime.CompilerServices;
 using System.Threading;
@@ -157,5 +156,4 @@ namespace System.Reactive.Concurrency
                 c();
         }
     }
-}
-#endif
+}

+ 0 - 2
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/IQueryLanguage.cs

@@ -313,12 +313,10 @@ namespace System.Reactive.Linq
 
         #region * Awaiter *
 
-#if HAS_AWAIT
         AsyncSubject<TSource> GetAwaiter<TSource>(IObservable<TSource> source);
         AsyncSubject<TSource> GetAwaiter<TSource>(IConnectableObservable<TSource> source);
         AsyncSubject<TSource> RunAsync<TSource>(IObservable<TSource> source, CancellationToken cancellationToken);
         AsyncSubject<TSource> RunAsync<TSource>(IConnectableObservable<TSource> source, CancellationToken cancellationToken);
-#endif
 
         #endregion
 

+ 2 - 5
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable.Async.cs

@@ -4,10 +4,8 @@
 
 using System.Reactive.Concurrency;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
+
 
 namespace System.Reactive.Linq
 {
@@ -1198,7 +1196,6 @@ namespace System.Reactive.Linq
 
         #region FromAsync
 
-#if !NO_TPL
 
         #region Func
 
@@ -1344,7 +1341,7 @@ namespace System.Reactive.Linq
 
         #endregion
 
-#endif
+
 
         #endregion
 

+ 0 - 2
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable.Awaiter.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if HAS_AWAIT
 using System.Threading;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
@@ -78,4 +77,3 @@ namespace System.Reactive.Linq
         }
     }
 }
-#endif

+ 1 - 3
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.Awaiter.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if HAS_AWAIT
 using System;
 using System.Threading;
 using System.Reactive.Disposables;
@@ -89,5 +88,4 @@ namespace System.Reactive.Linq
             subject.Subscribe(Stubs<T>.Ignore, _ => ctr.Dispose(), ctr.Dispose);
         }
     }
-}
-#endif
+}

+ 2 - 15
Rx.NET/Source/System.Reactive.Linq/Reactive/Subjects/AsyncSubject.cs

@@ -14,10 +14,7 @@ namespace System.Reactive.Subjects
     /// The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
     /// </summary>
     /// <typeparam name="T">The type of the elements processed by the subject.</typeparam>
-    public sealed class AsyncSubject<T> : SubjectBase<T>, IDisposable
-#if HAS_AWAIT
-        , INotifyCompletion
-#endif
+    public sealed class AsyncSubject<T> : SubjectBase<T>, IDisposable, INotifyCompletion
     {
         #region Fields
 
@@ -270,7 +267,6 @@ namespace System.Reactive.Subjects
 
         #region Await support
 
-#if HAS_AWAIT
         /// <summary>
         /// Gets an awaitable object for the current AsyncSubject.
         /// </summary>
@@ -292,7 +288,6 @@ namespace System.Reactive.Subjects
 
             OnCompleted(continuation, true);
         }
-#endif
 
         private void OnCompleted(Action continuation, bool originalContext)
         {
@@ -304,20 +299,14 @@ namespace System.Reactive.Subjects
 
         class AwaitObserver : IObserver<T>
         {
-#if HAS_AWAIT
             private readonly SynchronizationContext _context;
-#endif
             private readonly Action _callback;
 
             public AwaitObserver(Action callback, bool originalContext)
             {
-#if HAS_AWAIT
                 if (originalContext)
                     _context = SynchronizationContext.Current;
-#else
-                System.Diagnostics.Debug.Assert(!originalContext);
-#endif
-
+                
                 _callback = callback;
             }
 
@@ -337,7 +326,6 @@ namespace System.Reactive.Subjects
 
             private void InvokeOnOriginalContext()
             {
-#if HAS_AWAIT
                 if (_context != null)
                 {
                     //
@@ -350,7 +338,6 @@ namespace System.Reactive.Subjects
                     _context.Post(c => ((Action)c)(), _callback);
                 }
                 else
-#endif
                 {
                     _callback();
                 }