Inheritance: ModelElement
コード例 #1
0
 public void appendPreConditions(Lock aLock,PreCondition el)
 {
     __setDirty(true);
       el.__setDirty(true);
       allPreConditions().Add(el);
       acceptor.connectSon (this, el);
     NotifyControllers(aLock);
 }
コード例 #2
0
 public void insertPreConditions(int idx, PreCondition el,Lock aLock)
 {
     __setDirty(true);
       allPreConditions().Insert (idx, el);
     NotifyControllers(aLock);
 }
コード例 #3
0
 public virtual void visit(PreCondition obj, bool visitSubNodes)
 {
     visit ((BaseModelElement) obj, false);
     if (visitSubNodes){
     IXmlBBase[] Subs  = acceptor.subElements((IXmlBBase)obj);
     if (Subs != null){
     for (int i=0; i<Subs.Length; i++) {
       dispatch(Subs[i], true);
     } // If
     } // If
     }
 }
コード例 #4
0
 public virtual void visit(PreCondition obj)
 {
     visit(obj, true);
 }
コード例 #5
0
 public void copyTo(PreCondition other)
 {
     base.copyTo(other);
     other.aCondition = aCondition;
     other.aComment = aComment;
 }
コード例 #6
0
 public void copyTo(PreCondition other)
 {
     other.aCondition = aCondition;
 }
コード例 #7
0
        public override void visit(PreCondition obj, bool subNodes)
        {
            Rules.PreCondition preCondition = obj as Rules.PreCondition;

            if (preCondition != null)
            {
                try
                {
                    // Check whether the expression is valid
                    Expression expression = checkExpression(preCondition, preCondition.Condition);
                    if (expression != null)
                    {
                        if (!preCondition.Dictionary.EFSSystem.BoolType.Match(expression.GetExpressionType()))
                        {
                            preCondition.AddError("Expression type should be Boolean");
                        }

                        ITypedElement element = OverallTypedElementFinder.INSTANCE.findByName(preCondition,
                            preCondition.findVariable());
                        if (element != null)
                        {
                            if (element.Type is Types.StateMachine)
                            {
                                if (preCondition.findOperator() != null)
                                {
                                    if (preCondition.findOperator().CompareTo("==") == 0)
                                    {
                                        preCondition.AddWarning("Operator == should not be used for state machines");
                                    }
                                    else if (preCondition.findOperator().CompareTo("!=") == 0)
                                    {
                                        preCondition.AddWarning("Operator != should not be used for state machines");
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception exception)
                {
                    preCondition.AddException(exception);
                }
            }

            base.visit(obj, subNodes);
        }