Exemplo n.º 1
0
        protected virtual async Task OnLoad()
        {
            var statuses = await Context.Twitter.Statuses.Filter(CountExpression, StatusFilterExpression);

            var list = new List <StatusViewModel>();

            foreach (var s in statuses.Where(s => !Muter.IsMuted(s)))
            {
                list.Add(await CreateViewModel(s));
            }

            await AddStatuses(list);
        }
Exemplo n.º 2
0
        private async Task LoadTopData()
        {
            var statuses =
                await Context.Twitter.Statuses.Filter(CountExpression, StatusFilterExpression, SinceIdFilterExpression);

            var list = new List <StatusViewModel>();

            foreach (var s in statuses.Where(s => !Muter.IsMuted(s)).Reverse())
            {
                list.Add(await CreateViewModel(s));
            }

            await AddStatuses(list, false);
        }
Exemplo n.º 3
0
        protected override async Task LoadTopData()
        {
            var statuses =
                await Context.Twitter.Favorites.List(Context.UserId, SinceIdFilterExpressionFavorites);

            var list = new List <StatusViewModel>();

            foreach (var s in statuses.Where(s => !Muter.IsMuted(s)).Reverse())
            {
                list.Add(await CreateViewModel(s));
            }

            await AddItems(list);
        }
Exemplo n.º 4
0
        private async void OnFiltersUpdated(FilterUpdateMessage msg)
        {
            var toDelete = new List <StatusViewModel>();

            foreach (var item in Items.OfType <StatusViewModel>())
            {
                if (Muter.IsMuted(item.Model))
                {
                    toDelete.Add(item);
                }
            }

            msg.RemoveCount += toDelete.Count;
            await Dispatcher.RunAsync(() => toDelete.ForEach(it => Items.Remove(it)));
        }
Exemplo n.º 5
0
        protected virtual async Task LoadMoreData()
        {
            var statuses =
                await Context.Twitter.Statuses.Filter(CountExpression, StatusFilterExpression, MaxIdFilterExpression);

            var list = new List <StatusViewModel>();
            await Cache.MapStatusesToColumn(statuses, Definition.Id);

            foreach (var s in statuses.Where(s => !Muter.IsMuted(s)))
            {
                list.Add(await CreateViewModel(s));
            }

            await AddItems(list);
        }
Exemplo n.º 6
0
        private async void Parser_StatusReceived(object sender, StatusStreamEventArgs e)
        {
            if (Muter.IsMuted(e.Status))
            {
                return;
            }

            if (!IsSuitableForColumn(e.Status))
            {
                return;
            }

            var s = await CreateViewModel(e.Status);

            await AddStatus(s, false);
        }
Exemplo n.º 7
0
        protected virtual async Task OnLoad(AsyncLoadContext context)
        {
            var list           = new List <StatusViewModel>();
            var cachedStatuses = await Cache.GetStatusesForColumn(Definition.Id, Configuration.General.TweetFetchCount);

            foreach (var s in cachedStatuses.Where(s => !Muter.IsMuted(s)))
            {
                list.Add(await CreateViewModel(s, context));
            }

            await AddItems(list);

            var filterList = new List <Expression <Func <Status, bool> > >(3)
            {
                CountExpression,
                StatusFilterExpression
            };

            if (SinceId != 0)
            {
                filterList.Add(SinceIdFilterExpression);
            }

            var statuses = await Context.Twitter.Statuses.Filter(filterList.ToArray());

            await Cache.MapStatusesToColumn(statuses, Definition.Id);

            list.Clear();

            foreach (var s in statuses.Where(s => !Muter.IsMuted(s)))
            {
                list.Add(await CreateViewModel(s, context));
            }

            await AddItems(list);
        }