Ejemplo n.º 1
0
        protected async Task InsertStreamInTimeLineAsync(RowBase row)
        {

            if (await IsAllFilterClearAsync(row.Tweet))
            {
                if (IsNewNotification == true)
                {
                    if (row is NotificationRow)
                    {
                        var r=row as NotificationRow;
                        timelineActionCallback(new TimelineAction(TimelineActionType.NewNotification, new NotificationMessage
                        {
                            Message = r.Message,
                            TweetMessage = row.Tweet
                        }));
                    }
                    else
                    {
                        timelineActionCallback(new TimelineAction(TimelineActionType.NewNotification, new NotificationMessage
                        {
                            Message = "Notification",
                            TweetMessage = row.Tweet
                        }));
                    }
                    
                    
                }
                await SharedDispatcher.RunAsync(() =>
                {
                    TimeLine.Insert(0, row);

                });

                await LiveTileImageUpdateAsync(row.Tweet);
            }

        }
Ejemplo n.º 2
0
        protected async Task InsertRestInTimeLineAsync(List<RowBase> tweetList)
        {
            if (tweetList != null)
            {
                List<RowBase> tempTweetList = new List<RowBase>();
                RowBase[] tweetListCopy = null;
                await Task.Run(async () =>
                {
                    tweetList.Reverse();
                    tweetListCopy = new RowBase[TimeLine.Count];
                    TimeLine.CopyTo(tweetListCopy, 0);


                    foreach (var tweet in tweetList)
                    {
                        if (await IsAllFilterClearAsync(tweet.Tweet))
                        {
                            if (await isCompetition(tweetListCopy.ToList(), tweet.Tweet) == false)
                            {
                                tempTweetList.Add(tweet);
                            }
                        }
                    }
                });
                await SharedDispatcher.RunAsync(() =>
                    {
                        foreach (var tweet in tempTweetList)
                        {

                            TimeLine.Insert(0, tweet);

                        }
                    });
                //TimeLine.OrderBy(q => q.Tweet.created_at_time).Select(q => q);


            }
        }