public async Task <IEnumerable <IPost> > GetAsync(IWallHolder wallHolder, PullerSettings settings, CancellationToken ct) { var postList = new List <IPost>(); postList.AddRange(await getPostsWithAnOffset(wallHolder.ID, 100, 0, ct)); postList.Sort((a, b) => a.Date.CompareTo(b.Date)); return(postList); }
public async Task <IEnumerable <IPost> > GetAsync(IWallHolder wallHolder, PullerSettings settings, CancellationToken ct) { var postList = new List <IPost>(); postList.AddRange(await getPostsOfPage(wallHolder.ID, ITEMS_PER_PAGE, 0)); postList.Sort((a, b) => b.Date.CompareTo(a.Date)); return(postList); }
public WallItem([NotNull] IWallHolder wallHolder) { if (wallHolder == null) { throw new ArgumentNullException(nameof(wallHolder)); } WallHolder = wallHolder; ClickCommand = new DelegateCommand(() => OnClicked(this)); Name = WallHolder.Name; Photo = WallHolder.Photo50; }
public async Task <IEnumerable <IPost> > GetAsync(IWallHolder wallHolder, PullerSettings settings, CancellationToken ct) { var timePeriodSettings = settings as TimePeriodSettings; if (timePeriodSettings == null) { var noSettings = settings as NoPullerSettings; if (noSettings == null) { throw new VkException("Не предоставлены корректные настройки"); } } var days = timePeriodSettings?.Days ?? 1; var postList = new List <IPost>(); const int postsToPull = 25; int offset = 0; while (true) { postList.AddRange(await getPostsWithAnOffset(wallHolder.ID, postsToPull, offset, ct)); offset += postsToPull; if (postList.LastOrDefault().Date > days) { ; } } if (postList.Count == 100) { postList.AddRange(await getPostsWithAnOffset(wallHolder.ID, 50, 100, ct)); } postList.Sort((a, b) => a.Date.CompareTo(b.Date)); return(postList); }
public Task <IEnumerable <IPost> > GetAsync(IWallHolder wallHolder, PullerSettings settings) { return(GetAsync(wallHolder, settings, CancellationToken.None)); }
private void OnWallHolderChanged(IWallHolder e) { logger.Trace($"WallHolder был изменен. Новое Id - {e.ID}, Name - {e.Name}"); WallHolderChanged?.Invoke(this, e); }
public SharedWallContext() { _selectedWallHolder = new WallHolder(0); }
private void onPostponedWallHolderChanged(object sender, IWallHolder holder) { //var thisGroup = await _vkApi.GroupsGetById.GetAsync(holder.ID); IsGroup = holder.ID < 0; WallName = holder?.Name; }
private void onPostponedWallHolderChanged(object sender, IWallHolder wallHolder) { Name = wallHolder.Name; Description = wallHolder.Description; SetProfilePhoto(wallHolder.Photo200); }