Esempio n. 1
0
        private void DumpFeed(string hdr, SocialFeed feed)
        {
            Response.Write("<h2>" + hdr + "</h2>");
            foreach (SocialThread thread in feed.Threads)
            {
                Response.Write(
                    string.Format("{0} (Owner = {1})<ul>",
                                  thread.ThreadType,
                                  FormatActor(thread.Actors[thread.OwnerIndex])));

                Response.Write(
                    string.Format("<li>{0}: {1} (Author = {2})</li><ul>",
                                  thread.RootPost.PostType,
                                  thread.RootPost.Text,
                                  FormatActor(thread.Actors[thread.RootPost.AuthorIndex])));

                foreach (SocialPost reply in thread.Replies)
                {
                    Response.Write(
                        string.Format("<li>{0}: {1} (Author = {2})</li>",
                                      reply.PostType,
                                      reply.Text,
                                      FormatActor(thread.Actors[reply.AuthorIndex])));
                }
                Response.Write("</ul></ul>");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Iterates through the feeds retrieved for the target user.
        /// </summary>
        /// <param name="feed">Collection of Feeds retrieved.</param>
        /// <param name="feedType">Type of feed.</param>
        public void IterateThroughFeed(SocialFeed feed, SocialFeedType feedType)
        {
            try
            {
                SocialThread[] threads = feed.Threads;

                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    lstFeeds.Items.Clear();
                });

                foreach (SocialThread thread in threads)
                {
                    if (thread.ThreadType == SocialThreadType.Normal)
                    {
                        // Get the root post text value and add to the list.
                        SocialPost rootPost = thread.RootPost;
                        Feed       objFeed  = new Feed();
                        objFeed.FeedText = rootPost.Text;
                        Deployment.Current.Dispatcher.BeginInvoke(() =>
                        {
                            lstFeeds.Items.Add(objFeed);
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show("Error:   " + ex.Message);
                });
            }
        }
Esempio n. 3
0
 public UserAccount GetUser([Parent] SocialFeed feed, IResolverContext ctx)
 {
     return(_ovidDb.UserAccounts.Where(m => m.AccountId == feed.AccountId).SingleOrDefault());
 }