예제 #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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
파일: PlayOn.cs 프로젝트: swettk/PlayPass
 /// <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;
 }