示例#1
0
        public static ScriptControl Parse(XElement node)
        {
            ScriptControl rst = new ScriptControl();

            rst.Type  = Tools.GetXmlAttribute(node, "type");
            rst.Value = Tools.GetXmlAttribute(node, "value");
            if (node.Elements("condition") != null)
            {
                foreach (var conditionNode in node.Elements("condition"))
                {
                    rst.Conditions.Add(EventCondition.Parse(conditionNode));
                }
            }
            return(rst);
        }
示例#2
0
        public static Result Parse(XElement node)
        {
            Result rst = new Result();

            rst.Ret = Tools.GetXmlAttribute(node, "ret");
            if (node.Attribute("type") != null)
            {
                rst.Type = Tools.GetXmlAttribute(node, "type");
            }
            if (node.Attribute("value") != null)
            {
                rst.Value = Tools.GetXmlAttribute(node, "value");
            }
            if (node.Elements("control") != null)
            {
                foreach (var ctrl in node.Elements("control"))
                {
                    rst.Controls.Add(ScriptControl.Parse(ctrl));
                }
            }
            return(rst);
        }