isContainer() 공개 메소드

public isContainer ( ) : System.Boolean
리턴 System.Boolean
예제 #1
0
        public virtual void addItem(MediaItem _mediaItem, Int32 _itemIndexTo, Boolean _sync = false, Boolean _fromList = false)
        {
            Boolean isQueueCreated;

            if (_mediaItem == null)
            {
                this.writeLog(LogType.Error, String.Format("Hinzufügen von MediaItem zu Liste {0} fehlgeshlagen!", listId));
                return;
            }

            try
            {

                //if there is no queue the create a queue (do this with sync method!)
                // we always create a queue if there isn't one. We avoid direct links to containers
                isQueueCreated = this.createQueue();

                if (_mediaItem.itemType == MediaItemItemType.Shuffle)
                {
                    // no implementation for 'unSync' action for shuffle!
                    this.addShuffle(_mediaItem, _itemIndexTo, _sync);
                }
                else if (_mediaItem.isContainer())
                {
                    if (_sync)
                        contentDirectory.AddContainerToQueueSync(containerId, _mediaItem.objectId, _mediaItem.objectId, "", "", 0, 294967295, Convert.ToUInt32(_itemIndexTo));
                    else
                        contentDirectory.AddContainerToQueue(containerId, _mediaItem.objectId, _mediaItem.objectId, "", "", 0, 294967295, Convert.ToUInt32(_itemIndexTo), _mediaItem, addContainerSink);
                }
                else
                {
                    if (_sync)
                        contentDirectory.AddItemToQueueSync(containerId, _mediaItem.objectId, Convert.ToUInt32(_itemIndexTo));
                    else
                        contentDirectory.AddItemToQueue(containerId, _mediaItem.objectId, Convert.ToUInt32(_itemIndexTo), _mediaItem, addItemSink);
                }

                if (isQueueCreated)
                {
                    if (queueCreated != null) queueCreated(listId);
                }

                if (_sync && !_fromList)
                {
                    if (itemAdded != null) itemAdded(this.listId, _mediaItem, 1, 1);
                }

                // rebuild of internal list will be done when retrieven the new information from renderer.
                // this may lead to a little "slow" playlist, but it will always be accurate!

            }
            catch (Exception e)
            {
                this.writeLog(LogType.Error, String.Format("Fehler beim hinzufügen von Song '{0}' zu Liste '{1}'", _mediaItem.text, this.listId), e);
            }
        }
예제 #2
0
        public virtual void addItem(MediaItem _mediaItem, Int32 _itemIndexTo, Boolean _sync = false, Boolean _fromList = false)
        {
            Boolean isQueueCreated;

            if (_mediaItem == null)
            {
                this.writeLog(LogType.Error, String.Format("Hinzufügen von MediaItem zu Liste {0} fehlgeshlagen!", listId));
                return;
            }

            try
            {
                //if there is no queue the create a queue (do this with sync method!)
                // we always create a queue if there isn't one. We avoid direct links to containers
                isQueueCreated = this.createQueue();

                if (_mediaItem.itemType == MediaItemItemType.Shuffle)
                {
                    // no implementation for 'unSync' action for shuffle!
                    this.addShuffle(_mediaItem, _itemIndexTo, _sync);
                }
                else if (_mediaItem.isContainer())
                {
                    if (_sync)
                    {
                        contentDirectory.AddContainerToQueueSync(containerId, _mediaItem.objectId, _mediaItem.objectId, "", "", 0, 294967295, Convert.ToUInt32(_itemIndexTo));
                    }
                    else
                    {
                        contentDirectory.AddContainerToQueue(containerId, _mediaItem.objectId, _mediaItem.objectId, "", "", 0, 294967295, Convert.ToUInt32(_itemIndexTo), _mediaItem, addContainerSink);
                    }
                }
                else
                {
                    if (_sync)
                    {
                        contentDirectory.AddItemToQueueSync(containerId, _mediaItem.objectId, Convert.ToUInt32(_itemIndexTo));
                    }
                    else
                    {
                        contentDirectory.AddItemToQueue(containerId, _mediaItem.objectId, Convert.ToUInt32(_itemIndexTo), _mediaItem, addItemSink);
                    }
                }

                if (isQueueCreated)
                {
                    if (queueCreated != null)
                    {
                        queueCreated(listId);
                    }
                }

                if (_sync && !_fromList)
                {
                    if (itemAdded != null)
                    {
                        itemAdded(this.listId, _mediaItem, 1, 1);
                    }
                }


                // rebuild of internal list will be done when retrieven the new information from renderer.
                // this may lead to a little "slow" playlist, but it will always be accurate!
            }
            catch (Exception e)
            {
                this.writeLog(LogType.Error, String.Format("Fehler beim hinzufügen von Song '{0}' zu Liste '{1}'", _mediaItem.text, this.listId), e);
            }
        }