예제 #1
0
 public CommentView()
 {
     dt          = new DispatcherTimer();
     dt.Tick    += new EventHandler(AutoRefresh);
     dt.Interval = new TimeSpan(0, 5, 0);
     dt.Start();
     InitializeComponent();
     comments = ClientRequests.getComments();
     CommentList.ItemsSource = comments;
 }
예제 #2
0
 private void banComment(object sender, RoutedEventArgs e)
 {
     if (CommentList.SelectedItem == null)
     {
         MessageBox.Show("Please select a comment to decline");
         return;
     }
     ClientRequests.BanComment(comments.ElementAt(CommentList.SelectedIndex));
     comments = ClientRequests.getComments();
     CommentList.ItemsSource = comments;
 }
예제 #3
0
 public void approveComment(object sender, RoutedEventArgs args)
 {
     if (CommentList.SelectedItem == null)
     {
         MessageBox.Show("Please select a comment to approve");
         return;
     }
     ClientRequests.ApproveComment(comments.ElementAt(CommentList.SelectedIndex));
     comments = ClientRequests.getComments();
     CommentList.ItemsSource = comments;
 }
예제 #4
0
 public void Refresh()
 {
     comments = ClientRequests.getComments();
     CommentList.ItemsSource = comments;
 }