/// <summary> /// Returns a PlayOnItem based on the data in an XmlNode. /// </summary> public PlayOnItem GetItem(XmlNode Node) { string NodeType = Util.GetNodeAttributeValue(Node, "type"); PlayOnItem NewItem; if (Node.Name == "catalog") { NewItem = new PlayOnCatalog(this); } else if (NodeType == "folder") { NewItem = new PlayOnFolder(this); } else if (NodeType == "video") { NewItem = new PlayOnVideo(this); } else { throw new Exception(String.Format("Unhandled node type: {0}", NodeType)); } NewItem.LoadFromNode(Node); return(NewItem); }
/// <summary> /// Returns a PlayOnItem based on the data in an XmlNode. /// </summary> private PlayOnItem GetItem(XmlNode node) { var nodeType = Util.GetNodeAttributeValue(node, "type"); PlayOnItem newItem; if (node.Name == "catalog") { newItem = new PlayOnCatalog(this); } else if (nodeType == "folder") { newItem = new PlayOnFolder(this); } else if (nodeType == "video") { newItem = new PlayOnVideo(this); } else { throw new Exception(String.Format("Unhandled node type: {0}", nodeType)); } newItem.LoadFromNode(node); return(newItem); }
/// <summary> /// Returns a PlayOnItem based on the data in an XmlNode. /// </summary> private PlayOnItem GetItem(XmlNode node) { var nodeType = Util.GetNodeAttributeValue(node, "type"); PlayOnItem newItem; if (node.Name == "catalog") newItem = new PlayOnCatalog(this); else if (nodeType == "folder") newItem = new PlayOnFolder(this); else if (nodeType == "video") newItem = new PlayOnVideo(this); else throw new Exception(String.Format("Unhandled node type: {0}", nodeType)); newItem.LoadFromNode(node); return newItem; }