Beispiel #1
0
        /// <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);
        }