LoadCommands() публичный Метод

public LoadCommands ( System.Xml.Linq.XElement node, string basePath ) : List
node System.Xml.Linq.XElement
basePath string
Результат List
Пример #1
0
        public SceneCommandInfo Load(XElement node, string basePath)
        {
            var info = new MenuOptionCommandInfo();

            var nameAttr = node.Attribute("name");

            if (nameAttr != null)
            {
                info.Name = nameAttr.Value;
            }

            info.X = node.GetAttribute <int>("x");
            info.Y = node.GetAttribute <int>("y");

            var onNode = node.Element("On");

            if (onNode != null)
            {
                info.OnEvent = _commandReader.LoadCommands(onNode, basePath);
            }

            var offNode = node.Element("Off");

            if (offNode != null)
            {
                info.OffEvent = _commandReader.LoadCommands(offNode, basePath);
            }

            var selectNode = node.Element("Select");

            if (selectNode != null)
            {
                info.SelectEvent = _commandReader.LoadCommands(selectNode, basePath);
            }

            return(info);
        }
Пример #2
0
        public SceneCommandInfo Load(XElement node, string basePath)
        {
            var info = new SceneConditionCommandInfo();

            info.ConditionExpression = node.RequireAttribute("condition").Value;

            var attr = node.Attribute("entity");

            if (attr != null)
            {
                info.ConditionEntity = attr.Value;
            }

            info.Commands = _commandReader.LoadCommands(node, basePath);

            return(info);
        }