Exemplo n.º 1
0
        public static SimpleRuleDef AddSimpleRule(this RuleElementDefCollection ruleDefContainer, string name,
                                                  string condition)
        {
            var simpleRule = new SimpleRuleDef(name, condition);

            ruleDefContainer.Add(simpleRule);
            return(simpleRule);
        }
Exemplo n.º 2
0
        public static AddCollectionMemberActionDef AddAddCollectionMemberAction(
            this RuleElementDefCollection ruleDefContainer, string actionName, string collectionName)
        {
            var actionDef = new AddCollectionMemberActionDef();

            actionDef.Name           = actionName;
            actionDef.CollectionName = collectionName;
            ruleDefContainer.Add(actionDef);
            return(actionDef);
        }
Exemplo n.º 3
0
        public static AddCollectionMemberActionDef AddAddCollectionMemberAction(
            this RuleElementDefCollection ruleDefContainer, string name, string collectionName,
            params NameExpressionPairDef[] memberValues)
        {
            var action = new AddCollectionMemberActionDef(collectionName);

            action.Name = name;
            if (memberValues != null)
            {
                action.MemberValues = new NameExpressionPairDefCollection();
                action.MemberValues.AddRange(memberValues);
            }

            ruleDefContainer.Add(action);
            return(action);
        }