瀏覽代碼

Rename generic parameter on If.

Bart De Smet 8 年之前
父節點
當前提交
73cf6513f2
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      AsyncRx.NET/System.Reactive.Async.Linq/System/Reactive/Linq/Operators/If.cs

+ 10 - 10
AsyncRx.NET/System.Reactive.Async.Linq/System/Reactive/Linq/Operators/If.cs

@@ -9,11 +9,11 @@ namespace System.Reactive.Linq
 {
 {
     partial class AsyncObservable
     partial class AsyncObservable
     {
     {
-        public static IAsyncObservable<TSource> If<TSource>(Func<bool> condition, IAsyncObservable<TSource> thenSource) => If(condition, thenSource, Empty<TSource>());
+        public static IAsyncObservable<TResult> If<TResult>(Func<bool> condition, IAsyncObservable<TResult> thenSource) => If(condition, thenSource, Empty<TResult>());
 
 
-        public static IAsyncObservable<TSource> If<TSource>(Func<bool> condition, IAsyncObservable<TSource> thenSource, IAsyncScheduler scheduler) => If(condition, thenSource, Empty<TSource>(scheduler));
+        public static IAsyncObservable<TResult> If<TResult>(Func<bool> condition, IAsyncObservable<TResult> thenSource, IAsyncScheduler scheduler) => If(condition, thenSource, Empty<TResult>(scheduler));
 
 
-        public static IAsyncObservable<TSource> If<TSource>(Func<bool> condition, IAsyncObservable<TSource> thenSource, IAsyncObservable<TSource> elseSource)
+        public static IAsyncObservable<TResult> If<TResult>(Func<bool> condition, IAsyncObservable<TResult> thenSource, IAsyncObservable<TResult> elseSource)
         {
         {
             if (condition == null)
             if (condition == null)
                 throw new ArgumentNullException(nameof(condition));
                 throw new ArgumentNullException(nameof(condition));
@@ -22,7 +22,7 @@ namespace System.Reactive.Linq
             if (elseSource == null)
             if (elseSource == null)
                 throw new ArgumentNullException(nameof(elseSource));
                 throw new ArgumentNullException(nameof(elseSource));
 
 
-            return Create<TSource>(observer =>
+            return Create<TResult>(observer =>
             {
             {
                 var b = default(bool);
                 var b = default(bool);
 
 
@@ -32,18 +32,18 @@ namespace System.Reactive.Linq
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
-                    return Throw<TSource>(ex).SubscribeAsync(observer);
+                    return Throw<TResult>(ex).SubscribeAsync(observer);
                 }
                 }
 
 
                 return (b ? thenSource : elseSource).SubscribeSafeAsync(observer);
                 return (b ? thenSource : elseSource).SubscribeSafeAsync(observer);
             });
             });
         }
         }
 
 
-        public static IAsyncObservable<TSource> If<TSource>(Func<Task<bool>> condition, IAsyncObservable<TSource> thenSource) => If(condition, thenSource, Empty<TSource>());
+        public static IAsyncObservable<TResult> If<TResult>(Func<Task<bool>> condition, IAsyncObservable<TResult> thenSource) => If(condition, thenSource, Empty<TResult>());
 
 
-        public static IAsyncObservable<TSource> If<TSource>(Func<Task<bool>> condition, IAsyncObservable<TSource> thenSource, IAsyncScheduler scheduler) => If(condition, thenSource, Empty<TSource>(scheduler));
+        public static IAsyncObservable<TResult> If<TResult>(Func<Task<bool>> condition, IAsyncObservable<TResult> thenSource, IAsyncScheduler scheduler) => If(condition, thenSource, Empty<TResult>(scheduler));
 
 
-        public static IAsyncObservable<TSource> If<TSource>(Func<Task<bool>> condition, IAsyncObservable<TSource> thenSource, IAsyncObservable<TSource> elseSource)
+        public static IAsyncObservable<TResult> If<TResult>(Func<Task<bool>> condition, IAsyncObservable<TResult> thenSource, IAsyncObservable<TResult> elseSource)
         {
         {
             if (condition == null)
             if (condition == null)
                 throw new ArgumentNullException(nameof(condition));
                 throw new ArgumentNullException(nameof(condition));
@@ -52,7 +52,7 @@ namespace System.Reactive.Linq
             if (elseSource == null)
             if (elseSource == null)
                 throw new ArgumentNullException(nameof(elseSource));
                 throw new ArgumentNullException(nameof(elseSource));
 
 
-            return Create<TSource>(async observer =>
+            return Create<TResult>(async observer =>
             {
             {
                 var b = default(bool);
                 var b = default(bool);
 
 
@@ -62,7 +62,7 @@ namespace System.Reactive.Linq
                 }
                 }
                 catch (Exception ex)
                 catch (Exception ex)
                 {
                 {
-                    return await Throw<TSource>(ex).SubscribeAsync(observer).ConfigureAwait(false);
+                    return await Throw<TResult>(ex).SubscribeAsync(observer).ConfigureAwait(false);
                 }
                 }
 
 
                 return await (b ? thenSource : elseSource).SubscribeSafeAsync(observer).ConfigureAwait(false);
                 return await (b ? thenSource : elseSource).SubscribeSafeAsync(observer).ConfigureAwait(false);