Esempio n. 1
0
        /// <inheritdoc />
        public override void Invoke()
        {
            var negate = ActionName == "if-neq";

            if ((!negate && ArgumentA != ArgumentB) || (negate && ArgumentA == ArgumentB))
            {
                return;
            }

            foreach (var nestedXmlElement in NestedXmlElements)
            {
                ScriptReader.ExecuteElement(nestedXmlElement, DataContext, ParentAction);
            }
        }
Esempio n. 2
0
        /// <inheritdoc />
        public override void Invoke()
        {
            if (!Regex.IsMatch(Name, @"^\w+$"))
            {
                throw new ScriptException("Invalid list name provided. Name cannot be empty and must contain only alphanumeric characters and underscores.",
                                          ActionXmlElement, "name");
            }

            if (!DataContext.Lists.ContainsKey(Name))
            {
                DataContext.Lists.Add(Name, new List <string>());
            }

            ListValues = DataContext.Lists[Name];

            foreach (var nestedXmlElement in NestedXmlElements)
            {
                ScriptReader.ExecuteElement(nestedXmlElement, DataContext, this);
            }
        }