Esempio n. 1
0
 public bool addContextComponent(ContexteComponent component)
 {
     foreach (var comp in components)
     {
         if (comp.symbole.Equals(component.symbole) && comp.relationId.Equals(component.relationId))
         {
             return(true);
         }
     }
     this.components.Add(component);
     return(false);
 }
Esempio n. 2
0
        public override bool checkValue(Contexte contexte)
        {
            if (this.value)
            {
                return(this.value);
            }
            bool isSet = false;
            bool res   = false;
            bool error = false;

            for (var i = 0; i < this.relations.Count; i++)
            {
                var rel = this.relations[i];
                ContexteComponent component = new ContexteComponent(this.name, i);
                if (contexte.addContextComponent(component))
                {
                    isSet = true;
                    continue;
                }
                try
                {
                    res   = rel.checkValue(contexte);
                    isSet = true;
                }
                catch (UndefinedValueException)
                {}
                if (res)
                {
                    return(true);
                }
            }

            if (!isSet && this.relations.Count != 0)
            {
                throw new UndefinedValueException();
            }
            return((this.relations.Count == 0)?this.value:res);
        }