private async void SendBtn_Click(object sender, EventArgs e)
        {
            EditText content = FindViewById<EditText>(Resource.Id.PostCommentText);
            CheckBox anonCheck = FindViewById<CheckBox>(Resource.Id.PostCommentAnon);

            var res = await PostAPI.SendComment(Intent.GetIntExtra("PostID", 0), content.Text, anonCheck.Checked, AppPersistent.UserToken);

            if(res.error)
            {
                FeedbackHelper.ShowPopup(this, res.message);
            }
            else
            {
                FeedbackHelper.ShowPopup(this, "S U C C");
            }
        }
예제 #2
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var res = await PostAPI.SendComment(PostID, txtContent.Text, bAnon.IsChecked, AppPersistent.UserToken);

            if (!res.error)
            {
                DialogManager.ShowDialog("S U C C", "Comment sent");
            }
            else
            {
                DialogManager.ShowDialog("Not S U C C", res.message);
            }

            txtContent.Text = "";
            bAnon.IsChecked = false;
        }
예제 #3
0
 private async void btnSpamComments_Click(object sender, RoutedEventArgs e)
 {
     if (m_SpamCommentsList != null && m_SpamCommentsList.Length > 0)
     {
         btnSpamComments.IsEnabled = false;
         try
         {
             Random rnd = new Random();
             for (int i = 0; i < txtCommentsCount.Value; ++i)
             {
                 int idx = rnd.Next(0, m_SpamCommentsList.Length - 1);
                 var res = await PostAPI.SendComment((int)txtPostId.Value, m_SpamCommentsList[idx], bAnonymousComments.IsChecked, AppPersistent.UserToken);
             }
         }
         catch (Exception ex)
         {
             DialogManager.ShowDialog("Some rtarded shit happened", ex.Message);
         }
         DialogManager.ShowDialog("Success", "Comment section destoroyed ;)");
         btnSpamComments.IsEnabled = true;
     }
 }