示例#1
0
 protected override void Execute(Rules.RuleContext context)
 {
     if (context.InputPropertyValues.ContainsKey(PrimaryProperty))
     {
         context.AddErrorResult("PrimaryProperty has value.");
     }
     else
     {
         context.AddErrorResult("PrimaryProperty does not exist.");
     }
 }
示例#2
0
            protected override void Execute(Rules.RuleContext context)
            {
                var target = (T)context.Target;

                if (target.ChildList.Count < 1)
                {
                    context.AddErrorResult("At least one item required");
                }
            }
示例#3
0
        protected override void Execute(Rules.RuleContext context)
        {
            var v1 = (string)context.InputPropertyValues[PrimaryProperty];
            var v2 = (string)context.InputPropertyValues[SecondaryProperty];

            if (string.IsNullOrEmpty(v1) || string.IsNullOrEmpty(v2))
            {
                context.AddErrorResult(string.Format("v1:{0}, v2:{1}", v1, v2));
            }
        }
示例#4
0
 protected override void Execute(Rules.RuleContext context)
 {
     context.AddErrorResult("Always error");
 }
示例#5
0
 protected override void Execute(Rules.RuleContext context)
 {
     context.AddErrorResult("Bad rule");
 }