Exemplo n.º 1
0
        public static TerminalTriggerSet LoadFromXml(XmlElement parent)
        {
            var sets     = new TerminalTriggerSet();
            var nodeList = parent.GetElementsByTagName("triggerSet");

            if (nodeList == null || nodeList.Count == 0)
            {
                return(sets);
            }
            var node = (XmlElement)nodeList[0];

            if (node.Attributes["formula"] != null)
            {
                sets.Formula = node.Attributes["formula"].Value;
            }

            foreach (XmlElement child in node.ChildNodes)
            {
                var trigger = TerminalScriptTrigger.LoadFromXml(child);
                if (trigger != null)
                {
                    sets.triggers.Add(trigger);
                }
            }

            return(sets);
        }
Exemplo n.º 2
0
        public static TerminalTriggerSet LoadFromXml(XmlElement parent)
        {
            var sets = new TerminalTriggerSet();
            var nodeList = parent.GetElementsByTagName("triggerSet");
            if (nodeList == null || nodeList.Count == 0) return sets;
            var node = (XmlElement)nodeList[0];
            if (node.Attributes["formula"] != null)
                sets.Formula = node.Attributes["formula"].Value;

            foreach (XmlElement child in node.ChildNodes)
            {
                var trigger = TerminalScriptTrigger.LoadFromXml(child);
                if (trigger != null)
                    sets.triggers.Add(trigger);
            }

            return sets;
        }