예제 #1
0
        public void AddNewItem(IVideoItem item, bool isIncrease = true, bool isUpdateCount = true)
        {
            if (item == null)
            {
                throw new ArgumentException("item");
            }

            item.ParentTitle = Title;
            if (item.SyncState == SyncState.Added)
            {
                ChannelItems.Insert(0, item);
                if (isIncrease)
                {
                    CountNew += 1;
                }
            }
            else
            {
                ChannelItems.Add(item);
            }
            if (isUpdateCount)
            {
                ChannelItemsCount += 1;
            }
        }
        public void AddNewItem(IVideoItem item, bool isIncrease = true, bool isUpdateCount = true)
        {
            if (item == null)
            {
                throw new ArgumentException("item");
            }

            if (item.ParentTitle == null)
            {
                item.ParentTitle = item.ParentID;
            }
            if (ChannelItems.Select(x => x.ID).Contains(item.ID))
            {
                ChannelItems.Remove(ChannelItems.First(x => x.ID == item.ID));
            }

            item.FileState = ItemState.LocalNo;

            if (item.SyncState == SyncState.Added)
            {
                ChannelItems.Insert(0, item);
            }
            else
            {
                ChannelItems.Add(item);
            }
        }
예제 #3
0
 public void AddNewItem(IVideoItem item, bool isIncrease = true, bool isUpdateCount = true)
 {
     if (ChannelItems.Contains(item))
     {
         return;
     }
     item.IsHasLocalFileFound(DirPath);
     ChannelItems.Insert(0, item);
     if (isUpdateCount)
     {
         ChannelItemsCount += 1;
     }
 }