private Models.FollowItemType GetFollowItemType(Interfaces.IFollowable item) { if (item is Interfaces.ISearchWithtag) { return(Models.FollowItemType.Tag); } if (item is Interfaces.IUser) { return(Models.FollowItemType.User); } if (item is Interfaces.IMylist) { return(Models.FollowItemType.Mylist); } if (item is Interfaces.ICommunity) { return(Models.FollowItemType.Community); } if (item is Interfaces.IChannel) { return(Models.FollowItemType.Channel); } throw new NotSupportedException(); }
public bool IsFollowItem(Interfaces.IFollowable followItem) { if (followItem == null) { return(false); } return(IsFollowItem(ToFollowItemType(followItem), followItem.Id)); }
public bool CanMoreAddFollow(Interfaces.IFollowable followItem) { if (followItem == null) { return(false); } return(CanMoreAddFollow(ToFollowItemType(followItem))); }
static FollowItemType ToFollowItemType(Interfaces.IFollowable followItem) { switch (followItem) { case Interfaces.IChannel _: return(FollowItemType.Channel); case Interfaces.ICommunity _: return(FollowItemType.Community); case Interfaces.IUser _: return(FollowItemType.User); case Interfaces.IMylist _: return(FollowItemType.Mylist); case Interfaces.ITag _: return(FollowItemType.Tag); case Interfaces.ISearchWithtag _: return(FollowItemType.Tag); default: throw new NotSupportedException(); } }
public async Task <ContentManageResult> RemoveFollow(Interfaces.IFollowable followItem) { return(await RemoveFollow(ToFollowItemType(followItem), followItem.Id)); }
public async Task <ContentManageResult> AddFollow(Interfaces.IFollowable followItem, object token = null) { return(await AddFollow(ToFollowItemType(followItem), followItem.Id, followItem.Label, token)); }