Exemplo n.º 1
0
        private void redditNakedDownArrow_Click(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                Button myButton      = (Button)sender;
                object maybeAComment = myButton.DataContext;

                if (maybeAComment is CustomComment)
                {
                    CustomComment myComment = (CustomComment)maybeAComment;
                    myComment.ChangeVote(VotableThing.VoteType.Downvote);
                }
            }
        }
Exemplo n.º 2
0
        // I think I have the behaviour right, maybe there is an issue in CustomComment??

        // Behaviour if the up arrow HAS been clicked and this click removes the vote (Sets it to None Vote)
        private void redditUpArrow_Click(object sender, RoutedEventArgs e)
        {
            // Is it a button that is sent to me?
            if (sender is Button)
            {
                Button myButton      = (Button)sender;
                object maybeAComment = myButton.DataContext;

                if (maybeAComment is CustomComment)
                {
                    CustomComment myComment = (CustomComment)maybeAComment;
                    myComment.ChangeVote(VotableThing.VoteType.None);
                }
            }
        }
Exemplo n.º 3
0
 private void updateCommentBw_Completed(object sender, RunWorkerCompletedEventArgs e)
 {
     List<object> argumentList = e.Result as List<object>;
     Feed<Comment> comments = argumentList.ElementAt(0) as Feed<Comment>;
     commentSource.ListComment.Clear();
     for (int i = 0; i < comments.Entries.Count<Comment>(); i++)
     {
         Comment comment = comments.Entries.ElementAt(i);
         CustomComment customComment = new CustomComment(comment.Content, comment.Author, comment.Updated.ToString());
         commentSource.ListComment.Add(customComment);
     }
     this.commentsListBox.DataContext = commentSource;
 }