private void CommentList_SelectedIndexChanged(object sender, EventArgs e) { if (commentList.SelectedIndex == -1) { return; } Comment c = comments[commentList.SelectedIndex]; scoreLabel.Text = $" {c.score1} - {c.score2} - {c.score3} - {c.totalScore} vs {c.userScore}"; commentBox.Text = c.text; }
public Form1() { //RedditAggregator.RedditAggregator.TrainModels(); Controller.Controller _ = Controller.Controller.Instance; //now update all comments Comment.RepredictAll(); InitializeComponent(); subRedditList.Items.AddRange(subReddits.ToArray()); FormClosed += Form1_FormClosed; }
private void CommentBox_MouseDoubleClick(object sender, MouseEventArgs e) { if (commentList.SelectedIndex == -1) { return; } Comment c = comments[commentList.SelectedIndex]; c.userScore = userRating.Value / 5f; if (!Comment.Comments.Contains(c)) { Comment.Comments.Add(c); } }
private void UserRating_Scroll(object sender, EventArgs e) { if (commentList.SelectedIndex == -1) { return; } Comment c = comments[commentList.SelectedIndex]; c.userScore = userRating.Value / 5f; if (!Comment.Comments.Contains(c)) { Comment.Comments.Add(c); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { Comment.SaveComments(Comment.Comments, true); }