コード例 #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);
         }
     });
 }
コード例 #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);
         }
     });
 }
コード例 #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);
                }
            });
        }