Bart De Smet 5 лет назад
Родитель
Сommit
68ea39f9af

+ 78 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-// This code was generated by a T4 template at 10/05/2020 14:25:43.
+// This code was generated by a T4 template at 10/05/2020 14:49:21.
 
 namespace System.Reactive.Linq
 {
@@ -1206,6 +1206,11 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second)> CombineLatest<TFirst, TSecond>(this IObservable<TFirst> first, IObservable<TSecond> second)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+
             return s_impl.CombineLatest(first, second);
         }
 
@@ -1222,6 +1227,13 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third)> CombineLatest<TFirst, TSecond, TThird>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+
             return s_impl.CombineLatest(first, second, third);
         }
 
@@ -1240,6 +1252,15 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth)> CombineLatest<TFirst, TSecond, TThird, TFourth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+
             return s_impl.CombineLatest(first, second, third, fourth);
         }
 
@@ -1260,6 +1281,17 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+
             return s_impl.CombineLatest(first, second, third, fourth, fifth);
         }
 
@@ -1282,6 +1314,19 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+
             return s_impl.CombineLatest(first, second, third, fourth, fifth, sixth);
         }
 
@@ -1306,6 +1351,21 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> or <paramref name="seventh"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+            if (seventh == null)
+                throw new ArgumentNullException(nameof(seventh));
+
             return s_impl.CombineLatest(first, second, third, fourth, fifth, sixth, seventh);
         }
 
@@ -1332,6 +1392,23 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> or <paramref name="seventh"/> or <paramref name="eighth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth)> CombineLatest<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh, IObservable<TEighth> eighth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+            if (seventh == null)
+                throw new ArgumentNullException(nameof(seventh));
+            if (eighth == null)
+                throw new ArgumentNullException(nameof(eighth));
+
             return s_impl.CombineLatest(first, second, third, fourth, fifth, sixth, seventh, eighth);
         }
 

+ 10 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.CombineLatest.tt

@@ -114,6 +114,16 @@ for (int j = 0; j < i; j++)
         /// <exception cref="ArgumentNullException"><#=paramRefs#> is null.</exception>
         public static IObservable<<#=tuple#>> CombineLatest<<#=genArgs#>>(this <#=parameters#>)
         {
+<#
+for (int j = 0; j < i; j++)
+{
+#>
+            if (<#=ordinals[j]#> == null)
+                throw new ArgumentNullException(nameof(<#=ordinals[j]#>));
+<#
+}
+#>
+
             return s_impl.CombineLatest(<#=sources#>);
         }
 

+ 78 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-// This code was generated by a T4 template at 10/05/2020 14:25:34.
+// This code was generated by a T4 template at 10/05/2020 14:49:15.
 
 namespace System.Reactive.Linq
 {
@@ -1192,6 +1192,11 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this IObservable<TFirst> first, IObservable<TSecond> second)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+
             return s_impl.Zip(first, second);
         }
 
@@ -1208,6 +1213,13 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third)> Zip<TFirst, TSecond, TThird>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+
             return s_impl.Zip(first, second, third);
         }
 
@@ -1226,6 +1238,15 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth)> Zip<TFirst, TSecond, TThird, TFourth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+
             return s_impl.Zip(first, second, third, fourth);
         }
 
@@ -1246,6 +1267,17 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth)> Zip<TFirst, TSecond, TThird, TFourth, TFifth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+
             return s_impl.Zip(first, second, third, fourth, fifth);
         }
 
@@ -1268,6 +1300,19 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth)> Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+
             return s_impl.Zip(first, second, third, fourth, fifth, sixth);
         }
 
@@ -1292,6 +1337,21 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> or <paramref name="seventh"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh)> Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+            if (seventh == null)
+                throw new ArgumentNullException(nameof(seventh));
+
             return s_impl.Zip(first, second, third, fourth, fifth, sixth, seventh);
         }
 
@@ -1318,6 +1378,23 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="first"/> or <paramref name="second"/> or <paramref name="third"/> or <paramref name="fourth"/> or <paramref name="fifth"/> or <paramref name="sixth"/> or <paramref name="seventh"/> or <paramref name="eighth"/> is null.</exception>
         public static IObservable<(TFirst First, TSecond Second, TThird Third, TFourth Fourth, TFifth Fifth, TSixth Sixth, TSeventh Seventh, TEighth Eighth)> Zip<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(this IObservable<TFirst> first, IObservable<TSecond> second, IObservable<TThird> third, IObservable<TFourth> fourth, IObservable<TFifth> fifth, IObservable<TSixth> sixth, IObservable<TSeventh> seventh, IObservable<TEighth> eighth)
         {
+            if (first == null)
+                throw new ArgumentNullException(nameof(first));
+            if (second == null)
+                throw new ArgumentNullException(nameof(second));
+            if (third == null)
+                throw new ArgumentNullException(nameof(third));
+            if (fourth == null)
+                throw new ArgumentNullException(nameof(fourth));
+            if (fifth == null)
+                throw new ArgumentNullException(nameof(fifth));
+            if (sixth == null)
+                throw new ArgumentNullException(nameof(sixth));
+            if (seventh == null)
+                throw new ArgumentNullException(nameof(seventh));
+            if (eighth == null)
+                throw new ArgumentNullException(nameof(eighth));
+
             return s_impl.Zip(first, second, third, fourth, fifth, sixth, seventh, eighth);
         }
 

+ 10 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.Zip.tt

@@ -113,6 +113,16 @@ for (int j = 0; j < i; j++)
         /// <exception cref="ArgumentNullException"><#=paramRefs#> is null.</exception>
         public static IObservable<<#=tuple#>> Zip<<#=genArgs#>>(this <#=parameters#>)
         {
+<#
+for (int j = 0; j < i; j++)
+{
+#>
+            if (<#=ordinals[j]#> == null)
+                throw new ArgumentNullException(nameof(<#=ordinals[j]#>));
+<#
+}
+#>
+
             return s_impl.Zip(<#=sources#>);
         }