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; } } }
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); } } }
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); } }