コード例 #1
0
        public NicoFavoriteViewModel()
        {
            AddLoadTask(() =>
            {
                Mylists = NicoUtil.Favorites.ToSyncedSynchronizationContextCollection(
                    x => new NicoMylistViewModel(x.MylistId),
                    System.Threading.SynchronizationContext.Current
                    );
            });

            Disposed += (sender, e) =>
            {
                Mylists.ForEach(x => x.Dispose());
                Mylists.ClearOnUI();
            };
        }
コード例 #2
0
        public async Task <SearchVideoByMylistModel> GetMylist(string id)
        {
            var mylist = Mylists.FirstOrDefault(v => v.MylistId == id);

            if (mylist == null)
            {
                mylist = new SearchVideoByMylistModel(id)
                {
                    MylistId = id
                };
                await mylist.Reload();

                Mylists.Add(mylist);
            }

            return(mylist);
        }
コード例 #3
0
 public LoginUserMylistPlaylist GetMylistGroup(string groupId)
 {
     return(Mylists.SingleOrDefault(x => x.Id == groupId));
 }
コード例 #4
0
 public bool HasMylistGroup(string groupId)
 {
     return(Mylists.Any(x => x.Id == groupId));
 }
コード例 #5
0
 public bool CheckIsRegistratedAnyMylist(string videoId)
 {
     return(Mylists.Any(x => x.ContainsVideoId(videoId)));
 }
コード例 #6
0
 public UserOwnedMylist GetMylistGroup(string groupId)
 {
     return(Mylists.SingleOrDefault(x => x.GroupId == groupId));
 }