Ejemplo n.º 1
0
        void backgroundWorkerRecommendations_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            QuoteFmItem item = e.UserState as QuoteFmItem;

            if (item != null)
            {
                Recommendations.Add(item);
                if (InitialUpdateDoneForRecommendations)
                {
                    AppController.Current.sendNotification("QUOTE.fm " + User.username + " Recommendations", item.Author.Fullname, item.QuotedText, item.Author.Avatar, item);
                }
            }
        }
Ejemplo n.º 2
0
        void backgroundWorkerList_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            TwitterItem item = (TwitterItem)e.UserState;

            if (Items.Where(sItem => sItem.Id == item.Id).Count() == 0)
            {
                item.isList    = true;
                item.listName  = this.name;
                item.accountId = AccountId;
                try
                {
                    Items.Add(item);
                }
                catch (Exception exp)
                {
                    AppController.Current.Logger.writeToLogfile("Adding list item to collection failed");
                    AppController.Current.Logger.writeToLogfile(exp);
                    return;
                }

                if (InitialFetchDone)
                {
                    if (item.RetweetedItem != null)
                    {
                        AppController.Current.sendNotification("List " + FullName, item.RetweetedItem.Author.NameAndLogin, item.RetweetedItem.Text, item.RetweetedItem.Author.Avatar, item.RetweetedItem);
                    }
                    else
                    {
                        AppController.Current.sendNotification("List " + FullName, item.Author.NameAndLogin, item.Text, item.Author.Avatar, item);
                    }
                }

                if (item.Id > higehstKnownId)
                {
                    higehstKnownId = item.Id;
                }
            }
            else
            {
                item = null;
            }
        }