static Func <FollowItemInfo, FavoriteItemViewModel> MakeFavItemVMFactory(FollowItemType type) { Func <FollowItemInfo, FavoriteItemViewModel> fac = null; switch (type) { case FollowItemType.Tag: fac = item => new TagFavItemVM(item); break; case FollowItemType.Mylist: fac = item => new MylistFavItemVM(item); break; case FollowItemType.User: fac = item => new UserFavItemVM(item); break; case FollowItemType.Community: fac = item => new CommunityFavItemVM(item); break; case FollowItemType.Channel: fac = item => new ChannelFavItemVM(item); break; default: throw new NotSupportedException(); } return(fac); }
static Func <FollowItemInfo, FavoriteItemViewModel> MakeFavItemVMFactory(FollowItemType type) { Func <FollowItemInfo, FavoriteItemViewModel> fac = null; switch (type) { case FollowItemType.Tag: fac = item => App.Current.Container.Resolve <TagFavItemVM>(new ParameterOverride("follow", item)); break; case FollowItemType.Mylist: fac = item => App.Current.Container.Resolve <MylistFavItemVM>(new ParameterOverride("follow", item)); break; case FollowItemType.User: fac = item => App.Current.Container.Resolve <UserFavItemVM>(new ParameterOverride("follow", item)); break; case FollowItemType.Community: fac = item => App.Current.Container.Resolve <CommunityFavItemVM>(new ParameterOverride("follow", item)); break; case FollowItemType.Channel: fac = item => App.Current.Container.Resolve <ChannelFavItemVM>(new ParameterOverride("follow", item)); break; default: throw new NotSupportedException(); } return(fac); }
public async Task <ContentManageResult> RemoveFollow(FollowItemType itemType, string id) { var group = _FollowGroupsMap[itemType]; var result = await group.RemoveFollow(id); return(result); }
public async Task <ContentManageResult> AddFollow(FollowItemType itemType, string id, string name, object token = null) { var group = _FollowGroupsMap[itemType]; var result = await group.AddFollow(name, id, token); return(result); }
public async Task <ContentManageResult> RemoveFollow(FollowItemType itemType, string id, object token = null) { var group = GetFollowInfoGroup(itemType); var result = await group.RemoveFollow(id, token); return(result); }
public bool IsFollowItem(FollowItemType itemType, string id) { var group = _FollowGroupsMap[itemType]; if (itemType == FollowItemType.Tag) { id = TagStringHelper.ToEnsureHankakuNumberTagString(id); } return(group.IsFollowItem(id)); }
public static Database.BookmarkType FollowItemTypeConvertToFeedSourceType(FollowItemType followType) { switch (followType) { case FollowItemType.Tag: return(Database.BookmarkType.SearchWithTag); case FollowItemType.Mylist: return(Database.BookmarkType.Mylist); case FollowItemType.User: return(Database.BookmarkType.User); default: throw new NotSupportedException(followType.ToString() + " is not support feed group source type."); } }
public Task Sync(FollowItemType itemType) { switch (itemType) { case FollowItemType.Tag: return(Sync(Tag)); case FollowItemType.Mylist: return(Sync(Mylist)); case FollowItemType.User: return(Sync(User)); case FollowItemType.Community: return(Sync(Community)); default: return(Task.CompletedTask); } }
private IFollowInfoGroup GetFollowInfoGroup(FollowItemType itemType) { switch (itemType) { case FollowItemType.Tag: return(Tag); case FollowItemType.Mylist: return(Mylist); case FollowItemType.User: return(User); case FollowItemType.Community: return(Community); default: throw new Exception(); } }
public static NiconicoItemType?ToNiconicoItemType(this FollowItemType favorite) { switch (favorite) { case FollowItemType.Tag: return(null); case FollowItemType.Mylist: return(NiconicoItemType.Mylist); case FollowItemType.User: return(NiconicoItemType.User); case FollowItemType.Community: return(null); default: throw new NotSupportedException(); } }
public FollowItemInfo FindFollowInfo(FollowItemType itemType, string id) { return(_FollowGroupsMap[itemType].FollowInfoItems.SingleOrDefault(x => x.Id == id)); }
public bool CanMoreAddFollow(FollowItemType itemType) { return(_FollowGroupsMap[itemType].CanMoreAddFollow()); }
public bool ExistFeedSource(FollowItemType itemType, string id) { return _FeedSourceList.Any(x => x.FollowItemType == itemType && x.Id == id); }
public FollowItemInfo FindFollowInfo(FollowItemType itemType, string id) { return(GetFollowInfoGroup(itemType).FollowInfoItems.SingleOrDefault(x => x.Id == id)); }
public bool CanMoreAddFollow(FollowItemType itemType) { return(GetFollowInfoGroup(itemType).CanMoreAddFollow()); }