Exemple #1
0
        /// <summary>
        /// Creates a comment manager for the post and prefetches the comments
        /// </summary>
        /// <param name="post"></param>
        private void PreFetchPostComments(ref Post post, bool forcePreFetch = false, bool showThreadSubset = true)
        {
            // Ensure we don't already have the comments for this post
            lock (m_commentManagers)
            {
                for (int i = 0; i < m_commentManagers.Count; i++)
                {
                    if (m_commentManagers[i].Post.Id.Equals(post.Id))
                    {
                        return;
                    }
                }
            }

            // Create a comment manager for the post
            FlipViewPostCommentManager manager = new FlipViewPostCommentManager(ref post, m_targetComment, showThreadSubset);

            // If the user wanted, kick off pre load of comments.
            if (forcePreFetch || App.BaconMan.UiSettingsMan.FlipView_PreloadComments)
            {
                manager.PreFetchComments();
            }

            // Add the manager to the current list
            lock (m_commentManagers)
            {
                m_commentManagers.Add(manager);
            }
        }
Exemple #2
0
        private void CollapsedComment_Tapped(object sender, TappedRoutedEventArgs e)
        {
            Comment comment = (sender as FrameworkElement).DataContext as Comment;
            FlipViewPostCommentManager manager = FindCommentManager(comment.LinkId);

            if (manager != null)
            {
                manager.Expand_Tapped(comment);
            }
        }
Exemple #3
0
        private void CommentSave_Click(object sender, RoutedEventArgs e)
        {
            Comment comment = (sender as FrameworkElement).DataContext as Comment;
            FlipViewPostCommentManager manager = FindCommentManager(comment.LinkId);

            if (manager != null)
            {
                manager.Save_Tapped(comment);
            }
            App.BaconMan.TelemetryMan.ReportEvent(this, "CommentSaveTapped");
        }
Exemple #4
0
        private void CommentDown_Tapped(object sender, TappedRoutedEventArgs e)
        {
            // We don't need to animate here, the vote will do it for us
            Comment comment = (sender as FrameworkElement).DataContext as Comment;
            FlipViewPostCommentManager manager = FindCommentManager(comment.LinkId);

            if (manager != null)
            {
                manager.DownVote_Tapped(comment);
            }
        }
Exemple #5
0
        private void CommentCollpase_Tapped(object sender, TappedRoutedEventArgs e)
        {
            // Animate the text
            AnimateText((FrameworkElement)sender);

            Comment comment = (sender as FrameworkElement).DataContext as Comment;
            FlipViewPostCommentManager manager = FindCommentManager(comment.LinkId);

            if (manager != null)
            {
                manager.Collpase_Tapped(comment);
            }
        }
        /// <summary>
        /// Creates a comment manager for the post and prefetches the comments
        /// </summary>
        /// <param name="post"></param>
        private void PreFetchPostComments(ref Post post, bool forcePreFetch = false, bool showThreadSubset = true)
        {
            // Ensure we don't already have the comments for this post
            lock (m_commentManagers)
            {
                for (int i = 0; i < m_commentManagers.Count; i++)
                {
                    if (m_commentManagers[i].Post.Id.Equals(post.Id))
                    {
                        return;
                    }
                }
            }

            // Create a comment manager for the post
            FlipViewPostCommentManager manager = new FlipViewPostCommentManager(ref post, m_targetComment, showThreadSubset);

            // If the user wanted, kick off pre load of comments.
            if (forcePreFetch || App.BaconMan.UiSettingsMan.FlipView_PreloadComments)
            {
                manager.PreFetchComments();
            }

            // Add the manager to the current list
            lock(m_commentManagers)
            {
                m_commentManagers.Add(manager);
            }
        }