Beispiel #1
0
        public static IEnumerable<IScriptCommand> FromNodes(IEnumerable<XmlNode> nodes)
        {
            foreach (XmlNode node in nodes)
            {
                if (node.NodeType == XmlNodeType.Element)
                {
                    var result = new XmlScriptCommand(node);

                    yield return result;
                }
            }
        }
Beispiel #2
0
        public static IEnumerable <IScriptCommand> FromNodes(IEnumerable <XmlNode> nodes)
        {
            foreach (XmlNode node in nodes)
            {
                if (node.NodeType == XmlNodeType.Element)
                {
                    var result = new XmlScriptCommand(node);

                    yield return(result);
                }
            }
        }
Beispiel #3
0
        public void Add(string text)
        {
            try
            {
                var nodes       = Common.GetXml(text);
                var newCommands = XmlScriptCommand.FromNodes(nodes);
                Add(newCommands);
            }
            catch (RoomieScriptSyntaxErrorException)
            {
                //TODO: This is not the best way to detect the script format >.<

                var newCommands = TextScriptCommand.FromLines(text);
                Add(newCommands);
            }
        }