Exemplo n.º 1
0
 public static void ViewNotNull <T>(this IReadonlyProperty <T> me, Lifetime lifetime, Action <Lifetime, T> handler) where T : class
 {
     me.View(lifetime, (lf, v) =>
     {
         if (v != null)
         {
             handler(lf, v);
         }
     });
 }
Exemplo n.º 2
0
 public static void ViewNull <T>(this IReadonlyProperty <T?> me, Lifetime lifetime, Action <Lifetime> handler) where T : struct
 {
     me.View(lifetime, (lf, v) =>
     {
         if (v == null)
         {
             handler(lf);
         }
     });
 }
Exemplo n.º 3
0
        public static void WhenFalse([NotNull] this IReadonlyProperty <bool> property, Lifetime lifetime, [NotNull] Action <Lifetime> handler)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            property.View(lifetime, (lf, value) =>
            {
                if (!value)
                {
                    handler(lf);
                }
            });
        }