コード例 #1
0
        public RuleConstraintValue AddRuleConstraint(string left, string operation, string right)
        {
            var result = new RuleConstraintValue {
                Name = Utility.RandomString(10), Left = left, Operation = operation, Right = right
            };

            RuleConstraintValues.Add(result);
            UpdateRuleConstraints();
            return(result);
        }
コード例 #2
0
        public void UpdateRuleConstraint(string name, string left, string operation, string right)
        {
            if (RuleConstraintValues.All(x => x.Name != name))
            {
                RuleConstraintValues.Add(new RuleConstraintValue {
                    Name = name
                });
            }
            var rc = RuleConstraintValues.First(x => x.Name == name);

            rc.Left      = left;
            rc.Operation = operation;
            rc.Right     = right;
            UpdateRuleConstraints();
        }