Esempio n. 1
0
        /// <summary>
        ///     Creates an action in the enclosing rule condition
        /// </summary>
        /// <param name="enclosing"></param>
        /// <param name="expression"></param>
        /// <returns></returns>
        protected Action CreateAction(RuleCondition enclosing, string expression)
        {
            Action retVal = (Action)Factory.createAction();

            enclosing.appendActions(retVal);
            retVal.ExpressionText = expression;

            return(retVal);
        }
Esempio n. 2
0
        /// <summary>
        /// Splits the selected action to several sub-actions
        /// </summary>
        public virtual void SplitHandler(object sender, EventArgs args)
        {
            DataDictionary.Interpreter.Statement.Statement statement = Item.EFSSystem.Parser.Statement(Item, Item.ExpressionText);
            DataDictionary.Interpreter.Statement.VariableUpdateStatement variableUpdateStatement = statement as DataDictionary.Interpreter.Statement.VariableUpdateStatement;
            if (variableUpdateStatement != null)
            {
                DataDictionary.Interpreter.Expression       expression       = variableUpdateStatement.Expression;
                DataDictionary.Interpreter.StructExpression structExpression = expression as DataDictionary.Interpreter.StructExpression;
                if (structExpression != null)
                {
                    Dictionary <string, DataDictionary.Interpreter.Expression> associations = structExpression.Associations;
                    foreach (KeyValuePair <string, DataDictionary.Interpreter.Expression> value in associations)
                    {
                        DataDictionary.Rules.Action action = (DataDictionary.Rules.Action)DataDictionary.Generated.acceptor.getFactory().createAction();
                        action.Expression = structExpression.Structure.ToString() + "." + value.Key + " <- " + value.Value.ToString();
                        string         aString        = value.Value.ToString();
                        ActionTreeNode actionTreeNode = new ActionTreeNode(action);

                        BaseTreeNode parent = Parent as BaseTreeNode;
                        if ((parent != null) && (parent.Nodes != null))
                        {
                            DataDictionary.Rules.RuleCondition ruleCondition = Item.Enclosing as DataDictionary.Rules.RuleCondition;
                            if (ruleCondition != null)
                            {
                                ruleCondition.appendActions(action);
                            }
                            else
                            {
                                DataDictionary.Tests.SubStep subStep = Item.Enclosing as DataDictionary.Tests.SubStep;
                                if (subStep != null)
                                {
                                    subStep.appendActions(action);
                                }
                            }
                            parent.Nodes.Add(actionTreeNode);
                        }
                    }
                }
            }
            Delete();
            SortSubNodes();
        }
Esempio n. 3
0
        /// <summary>
        ///     Splits the selected action to several sub-actions
        /// </summary>
        public virtual void SplitHandler(object sender, EventArgs args)
        {
            Statement statement = new Parser().Statement(Item, Item.ExpressionText);
            VariableUpdateStatement variableUpdateStatement = statement as VariableUpdateStatement;

            if (variableUpdateStatement != null)
            {
                Expression       expression       = variableUpdateStatement.Expression;
                StructExpression structExpression = expression as StructExpression;
                if (structExpression != null)
                {
                    Dictionary <Designator, Expression> associations = structExpression.Associations;
                    foreach (KeyValuePair <Designator, Expression> value in associations)
                    {
                        Action action = (Action)acceptor.getFactory().createAction();
                        action.ExpressionText = structExpression.Structure + "." + value.Key + " <- " +
                                                value.Value;
                        ActionTreeNode actionTreeNode = new ActionTreeNode(action, true);

                        BaseTreeNode parent = Parent as BaseTreeNode;
                        if (parent != null)
                        {
                            RuleCondition ruleCondition = Item.Enclosing as RuleCondition;
                            if (ruleCondition != null)
                            {
                                ruleCondition.appendActions(action);
                            }
                            else
                            {
                                SubStep subStep = Item.Enclosing as SubStep;
                                if (subStep != null)
                                {
                                    subStep.appendActions(action);
                                }
                            }
                            parent.Nodes.Add(actionTreeNode);
                        }
                    }
                }
            }
            Delete();
        }
        /// <summary>
        ///     Creates an action in the enclosing rule condition
        /// </summary>
        /// <param name="enclosing"></param>
        /// <param name="expression"></param>
        /// <returns></returns>
        protected Action CreateAction(RuleCondition enclosing, string expression)
        {
            Action retVal = (Action) Factory.createAction();
            enclosing.appendActions(retVal);
            retVal.ExpressionText = expression;

            return retVal;
        }