/// <summary> /// Creates Pre Condition Rule /// </summary> /// <param name="conditions">Sequencing Rule Conditions.</param> /// <param name="ruleAction">Action.</param> /// <returns>PreConditionRuleType generated from arguments.</returns> public static PreConditionRuleType CreatePreConditionRule(ConditionCombinationType conditionCombination, IEnumerable<SequencingRuleTypeRuleConditionsRuleCondition> conditions, PreConditionRuleActionType ruleAction) { PreConditionRuleType result = new PreConditionRuleType(); result.ruleConditions = new SequencingRuleTypeRuleConditions(); result.ruleConditions.conditionCombination = conditionCombination; result.ruleConditions.ruleCondition = new ManifestNodeList<SequencingRuleTypeRuleConditionsRuleCondition>(result.ruleConditions); result.ruleConditions.ruleCondition.AddRange(conditions); result.ruleAction = new PreConditionRuleTypeRuleAction(); result.ruleAction.action = ruleAction; return result; }
/// <summary> /// Creates PreConditionRule with simple parameters. /// </summary> /// <param name="condition">SequencingRuleConditionType enumerable value represents Rule Condition.</param> /// <param name="action">PreConditionRuleActionType enumerable value represents PreCondition Rule Action.</param> /// <returns>PreConditionRuleType value with appropriate parameters.</returns> public static PreConditionRuleType CreateSimplePreConditionRule([NotNull]SequencingRuleConditionType condition, [NotNull]PreConditionRuleActionType action) { PreConditionRuleType preConditionRule = new PreConditionRuleType(); preConditionRule.ruleConditions = new SequencingRuleTypeRuleConditions(); preConditionRule.ruleConditions.ruleCondition = new ManifestNodeList<SequencingRuleTypeRuleConditionsRuleCondition>(preConditionRule.ruleConditions); preConditionRule.ruleConditions.ruleCondition.Add(new SequencingRuleTypeRuleConditionsRuleCondition()); preConditionRule.ruleConditions.ruleCondition[0].condition = condition; preConditionRule.ruleAction = new PreConditionRuleTypeRuleAction(); preConditionRule.ruleAction.action = action; return preConditionRule; }