Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        private void miAddPostConditionRule_Click(object sender, EventArgs e)
        {
            SequencingRulesType c = (SequencingRulesType)tvManifest.SelectedNode.Tag;

            PostConditionRuleType p = new PostConditionRuleType();

            c.postConditionRule.Parent = c;

            c.postConditionRule.Add(p);

            Forms.PropertyEditor.Show(p);
            tvManifest.SelectedNode.Expand();
        }
Beispiel #4
0
        private void miAddRuleAction_Click(object sender, EventArgs e)
        {
            if (tvManifest.SelectedNode.Tag is PreConditionRuleType)
            {
                PreConditionRuleType c = (PreConditionRuleType)tvManifest.SelectedNode.Tag;

                Debug.Assert(c.ruleAction == null, "Rule Action already exists");

                c.ruleAction = new PreConditionRuleTypeRuleAction();

                Forms.PropertyEditor.Show(c.ruleAction);
                tvManifest.SelectedNode.Expand();
            }
            if (tvManifest.SelectedNode.Tag is PostConditionRuleType)
            {
                PostConditionRuleType c = (PostConditionRuleType)tvManifest.SelectedNode.Tag;

                Debug.Assert(c.ruleAction == null, "Rule Action already exists");

                c.ruleAction = new PostConditionRuleTypeRuleAction();

                Forms.PropertyEditor.Show(c.ruleAction);
                tvManifest.SelectedNode.Expand();
            }
            if (tvManifest.SelectedNode.Tag is ExitConditionRuleType)
            {
                ExitConditionRuleType c = (ExitConditionRuleType)tvManifest.SelectedNode.Tag;

                Debug.Assert(c.ruleAction == null, "Rule Action already exists");

                c.ruleAction = new ExitConditionRuleTypeRuleAction();

                Forms.PropertyEditor.Show(c.ruleAction);
                tvManifest.SelectedNode.Expand();
            }
        }
Beispiel #5
0
        private void miAddPostConditionRule_Click(object sender, EventArgs e)
        {
            SequencingRulesType c = (SequencingRulesType) tvManifest.SelectedNode.Tag;

            PostConditionRuleType p = new PostConditionRuleType();

            c.postConditionRule.Parent = c;

            c.postConditionRule.Add(p);

            Forms.PropertyEditor.Show(p);
            tvManifest.SelectedNode.Expand();
        }