Esempio n. 1
0
        /// <summary>
        /// Creates Post Condition Rule
        /// </summary>
        /// <param name="conditions">Sequencing Rule Conditions.</param>
        /// <param name="ruleAction">Action.</param>
        /// <returns>PostConditionRuleType generated from arguments.</returns>
        public static PostConditionRuleType CreatePostConditionRule(ConditionCombinationType conditionCombination, IEnumerable<SequencingRuleTypeRuleConditionsRuleCondition> conditions, PostConditionRuleActionType ruleAction)
        {
            PostConditionRuleType result = new PostConditionRuleType();
            result.ruleConditions = new SequencingRuleTypeRuleConditions();
            result.ruleConditions.conditionCombination = conditionCombination;
            result.ruleConditions.ruleCondition = new ManifestNodeList<SequencingRuleTypeRuleConditionsRuleCondition>(result.ruleConditions);
            result.ruleConditions.ruleCondition.AddRange(conditions);
            result.ruleAction = new PostConditionRuleTypeRuleAction();
            result.ruleAction.action = ruleAction;

            return result;
        }
Esempio n. 2
0
 /// <summary>
 /// Creates PostConditionRule with simple parameters.
 /// </summary>
 /// <param name="condition">SequencingRuleConditionType enumerable value represents Rule Condition.</param>
 /// <param name="action">PostConditionRuleActionType enumerable value represents PostCondition Rule Action.</param>
 /// <returns>PostConditionRuleType value with appropriate parameters.</returns>
 public static PostConditionRuleType CreateSimplePostConditionRule([NotNull]SequencingRuleConditionType condition, [NotNull]PostConditionRuleActionType action)
 {
     PostConditionRuleType postConditionRule = new PostConditionRuleType();
     postConditionRule.ruleConditions = new SequencingRuleTypeRuleConditions();
     postConditionRule.ruleConditions.ruleCondition = new ManifestNodeList<SequencingRuleTypeRuleConditionsRuleCondition>(postConditionRule.ruleConditions);
     postConditionRule.ruleConditions.ruleCondition.Add(new SequencingRuleTypeRuleConditionsRuleCondition());
     postConditionRule.ruleConditions.ruleCondition[0].condition = condition;
     postConditionRule.ruleAction = new PostConditionRuleTypeRuleAction();
     postConditionRule.ruleAction.action = action;
     return postConditionRule;
 }