private void ParseCondition(Conditions c, XmlElement element, params object[] parameters) { switch (element.Name) { case "either": c.add(parseEither(element, parameters)); break; case "active": case "inactive": c.add(parseFlag(element, parameters)); break; case "greater-than": case "greater-equals-than": case "less-than": case "less-equals-than": case "equals": case "not-equals": c.add(parseVar(element, parameters)); break; case "global-state-ref": c.add(parseGlobal(element, parameters)); break; } }
public virtual object Clone() { Conditions clone = (Conditions)this.MemberwiseClone(); clone.conditionsList = new List <List <Condition> >(); foreach (List <Condition> wrapper in this.conditionsList) { List <Condition> wrapperClone = new List <Condition>(); clone.add(wrapperClone); foreach (Condition condition in wrapper) { wrapperClone.Add((Condition)condition.Clone()); } } return(clone); }
/** * Returns a list with all the either condition blocks. This method is only * held for past compatibility * * @return List of conditions */ private List <Conditions> getEitherConditions() { List <Conditions> conditions = new List <Conditions>(); foreach (List <Condition> wrapper in conditionsList) { if (wrapper.Count > 1) { Conditions eitherBlock = new Conditions(); foreach (Condition condition in wrapper) { eitherBlock.add(condition); } conditions.Add(eitherBlock); } } return(conditions); }