Пример #1
0
 public static IValueConverter <Tuple <T, T, T, T> > Periodic <T>(this IValueConverter <T> converter)
 {
     return(converter.To(m => Tuple.Create(m, m, m, m)).Or(
                new ArgumentsValueConverter <T, T>(converter, converter).To(m => Tuple.Create(m.Item1, m.Item2, m.Item1, m.Item2))).Or(
                new ArgumentsValueConverter <T, T, T>(converter, converter, converter).To(m => Tuple.Create(m.Item1, m.Item2, m.Item3, m.Item2))).Or(
                new ArgumentsValueConverter <T, T, T, T>(converter, converter, converter, converter)));
 }
Пример #2
0
 public static IValueConverter <Nullable <T> > ToNullable <T>(this IValueConverter <T> primary)
     where T : struct
 {
     return(primary.To(m => new T?(m)));
 }