Exemple #1
0
 public static IReadOnlyObservableValue <long> Subtract(this IReadOnlyObservableValue <int> self,
                                                        long other)
 {
     return(self.Map((a) => a - other));
 }
Exemple #2
0
 public static IReadOnlyObservableValue <decimal> Subtract(this IReadOnlyObservableValue <int> self,
                                                           decimal other)
 {
     return(self.Map((a) => a - other));
 }
Exemple #3
0
 public static IReadOnlyObservableValue <float> Add(this IReadOnlyObservableValue <float> self,
                                                    short other)
 {
     return(self.Map((a) => a + other));
 }
Exemple #4
0
 public static IReadOnlyObservableValue <decimal> Add(this IReadOnlyObservableValue <decimal> self,
                                                      byte other)
 {
     return(self.Map((a) => a + other));
 }
 public static IReadOnlyObservableValue <bool> Not(this IReadOnlyObservableValue <bool> that)
 {
     return(that.Map(b => !b));
 }
 public static IReadOnlyObservableValue <bool> EqualTo <T>(this IReadOnlyObservableValue <T> that, T other)
 {
     return(that.Map(b => Equals(b, other)));
 }
 public static IReadOnlyObservableValue <T> Map <T>(this IReadOnlyObservableValue <bool> that,
                                                    T onTrue, T onFalse)
 {
     return(that.Map((b) => b ? onTrue: onFalse));
 }
Exemple #8
0
 public static IReadOnlyObservableValue <int> Length(this IReadOnlyObservableValue <string> that)
 {
     return(that.Map(b => b.Length));
 }
Exemple #9
0
 public static IReadOnlyObservableValue Filter <T>(this IReadOnlyObservableValue <T> source, Func <T, bool> filter, T defaultValue = default(T))
 {
     return(source.Map(v => filter(v) ? v : defaultValue));
 }
Exemple #10
0
 public static IReadOnlyObservableValue OrElse <T>(this IReadOnlyObservableValue <T> source, T fallback) where T : class
 {
     return(source.Map(v => v ?? fallback));
 }
Exemple #11
0
 public static IReadOnlyObservableValue Filter(this IReadOnlyObservableValue source, Func <object, bool> filter, object defaultValue = null)
 {
     return(source.Map(v => filter(v) ? v : defaultValue));
 }
Exemple #12
0
 public static IReadOnlyObservableValue <bool> IsNullOrEmpty(this IReadOnlyObservableValue <string> that)
 {
     return(that.Map(string.IsNullOrEmpty));
 }
Exemple #13
0
 public static IReadOnlyObservableValue <bool> IsEqualTo(this IReadOnlyObservableValue <string> that,
                                                         string text,
                                                         StringComparison c = StringComparison.InvariantCulture)
 {
     return(that.Map(b => string.Equals(b, text, c)));
 }
Exemple #14
0
 public static IReadOnlyObservableValue <double> Add(this IReadOnlyObservableValue <long> self,
                                                     double other)
 {
     return(self.Map((a) => a + other));
 }
 public static IReadOnlyObservableValue <bool> NotNull <T>(this IReadOnlyObservableValue <T> that) where T : class
 {
     return(that.Map(b => (b != null)));
 }
Exemple #16
0
 public static IReadOnlyObservableValue <double> Subtract(this IReadOnlyObservableValue <float> self,
                                                          double other)
 {
     return(self.Map((a) => a - other));
 }
Exemple #17
0
 public static IReadOnlyObservableValue <bool> IsNullOrWhitespace(this IReadOnlyObservableValue <string> that)
 {
     return(that.Map(string.IsNullOrWhiteSpace));
 }