Ejemplo n.º 1
0
        //*************************************************************************************************************
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (CommentBox.Text.Trim() == "")
            {
                CommentBox.ShowBalloon(ToolTipIcon.Warning, "", "Empty message?");
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            string message = "";

            message += "***************************** MESSAGE *****************************\n";
            message += CommentBox.Text + "\n";
            message += "****************************** NAME *******************************\n";
            message += NameBox.Text + "\n";
            message += "****************************** MAIL *******************************\n";
            message += MailBox.Text + "\n";
            message += "*******************************************************************\n";

            var           ravenClient = new RavenClient("https://[email protected]/5275199");
            SentryMessage msg         = new SentryMessage(message);
            SentryEvent   ev          = new SentryEvent(msg);

            ravenClient.Capture(ev);
            Close();
        }
Ejemplo n.º 2
0
 private void CaptchaTextBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         CommentBox.Focus();
     }
 }
Ejemplo n.º 3
0
        //************************************************************************************
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (CommentBox.Text.Trim() == "")
            {
                CommentBox.ShowBalloon(ToolTipIcon.Warning, "", "Empty message?");
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            string message = "";

            message += "***************************** MESSAGE *****************************\n";
            message += CommentBox.Text + "\n";
            message += "****************************** NAME *******************************\n";
            message += NameBox.Text + "\n";
            message += "****************************** MAIL *******************************\n";
            message += MailBox.Text + "\n";
            message += "*******************************************************************\n";

            var           ravenClient = new RavenClient("https://[email protected]/1210500");
            SentryMessage msg         = new SentryMessage(message);
            SentryEvent   ev          = new SentryEvent(msg);

            ravenClient.Capture(ev);
            Close();
        }
Ejemplo n.º 4
0
        private void CommentBtn_Click(object sender, EventArgs e)
        {
            var comment    = CommentBox.Text;
            var newContent = ProcessListBox.SelectedItem + "\t\t\t\t" + comment;

            ProcessListBox.Items[ProcessListBox.SelectedIndex] = newContent;
            Comments.Add(newContent);
            CommentBox.Clear();
        }
Ejemplo n.º 5
0
        public void FillApointment(UserProperties user)
        {
            Name.SendKeys(user.UserName);

            Family.SendKeys(user.UserFamilyName);

            Telephone.SendKeys(user.UserPhoneNumber);

            CommentBox.SendKeys(user.CommenentBox);

            Email.SendKeys(user.UserEmailAddress);
        }
Ejemplo n.º 6
0
        private async void CreateComment_Click(object sender, RoutedEventArgs e)
        {
            await SqliteContext.CreateCommentAsync(
                new Comment
            {
                Description = CommentBox.ToString(),
                IssueId     = await SqliteContext.GetIssuesAsync(cmbIssueTitle.SelectedItem.ToString())
            }

                );

            await LoadIssueByTitleAsync();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 抢沙发
        /// </summary>
        public void getSofa()
        {
            //获取投稿列表并选出文章投稿
            string  s1      = webutil.getPublish(webutil.cookiec);
            JObject jsonObj = JObject.Parse(s1);
            JArray  jar     = JArray.Parse(jsonObj["contents"].ToString());
            JObject j       = JObject.Parse(jar[0].ToString());

            contentList = JsonConvert.DeserializeObject(s1, typeof(List <contents>)) as List <contents>;
            if (contentList.Count > 0)
            {
                contents con = contentList[0];
                if (con.getIsArticle() == "1")
                {
                    CommentBox comment = new CommentBox();
                    comment.Show();
                }
            }
        }
Ejemplo n.º 8
0
        private void ElementFocused(object sender, NewThreadPageViewModel.NewThreadFocusResult e)
        {
            switch (e)
            {
            case NewThreadPageViewModel.NewThreadFocusResult.Captcha:
                Focus();
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    CaptchaTextBox.Focus();
                });
                break;

            case NewThreadPageViewModel.NewThreadFocusResult.Comment:
                CommentBox.Focus();
                break;

            case NewThreadPageViewModel.NewThreadFocusResult.Page:
                Focus();
                break;

            default:
                break;
            }
        }
Ejemplo n.º 9
0
 private void discussionLoaded(object sender, RoutedEventArgs e)
 {
     CommentBox.Focus();
 }
Ejemplo n.º 10
0
        protected void ButtonClick(object sender, EventArgs e)
        {
            if (main.signedIn)
            {
                if (sender.Equals(PostCommentButton))
                {
                    if (replyFlag == 0)
                    {
                        Comment newComment = new Comment(main.currUser.UserName, CommentBox.Text, this);
                        newComment.CurrentUser = true;
                        commentsFeed.Children.Add(newComment);
                        ScrollViewComments.ScrollToEnd();
                        discussion.GetComments().Add(newComment);
                        CommentBox.Text        = "";
                        CommentBoxDefault.Text = "Type a message...";
                        discussion.numReplies++;
                        string repliesString = discussion.numReplies.ToString();
                        repliesString             += (discussion.numReplies != 1) ? " replies" : " reply";
                        NumRepliesButton.Content   = repliesString;
                        discussion.replyCount.Text = repliesString;
                        CommentBox.Focus();
                        //parent.GetDiscussionDict()[discussion.GetDiscussionId()] = discussion;
                    }
                    else if (replyFlag == 1)
                    {
                        //string[] reply = CommentBox.Text.Split('\n');
                        Comment newComment = new Comment(main.currUser.UserName, CommentBox.Text, this);
                        newComment.CurrentUser = true;
                        commentToReplyTo.repliesFeed.Children.Add(newComment);
                        CommentBox.Text        = "";
                        CommentBoxDefault.Text = "Type a message...";
                        replyFlag        = 0;
                        commentToReplyTo = null;
                        discussion.numReplies++;
                        string repliesString = discussion.numReplies.ToString();
                        repliesString             += (discussion.numReplies != 1) ? " replies" : " reply";
                        NumRepliesButton.Content   = repliesString;
                        discussion.replyCount.Text = repliesString;
                        CommentBox.Focus();
                    }
                }
                else if (sender.Equals(DeleteButton))
                {
                    DeletePrompt prompt = new DeletePrompt(main, this);
                    prompt.SetMessage("This action cannot be undone, are you sure you want to proceed?");
                    prompt.ShowDialog();
                    main.HighlightTab();
                    if (prompt.confirmed == true)
                    {
                        // remove from discussions page
                        main.currDiscussionPage.discussionDict.Remove(discussion.discussionId);
                        main.currDiscussionPage.DisplayDiscussionPosts();
                        // remove from user's profile page
                        main.currUser.userDiscussions.Remove(discussion.discussionId);
                        main.currProfilePage.DisplayPosts();
                        // close popup window
                        this.Visibility = Visibility.Hidden;
                        main.ChangeFill(Visibility.Hidden);
                    }
                }
                else if (sender.Equals(EditButton))
                {
                    if (editable == false)
                    {
                        EditButton.Content    = "Save Changes";
                        EditButton.Background = Brushes.Yellow;

                        editable = true;

                        descriptionTextBox.Text          = DiscussionDescription.Text;
                        DiscussionDescription.Visibility = Visibility.Hidden;
                        descriptionTextBox.Visibility    = Visibility.Visible;
                        Keyboard.Focus(descriptionTextBox);
                        descriptionTextBox.CaretIndex = descriptionTextBox.Text.Length;
                    }
                    else
                    {
                        EditButton.Content               = "EDIT";
                        EditButton.Background            = Brushes.LightGray;
                        DiscussionDescription.Visibility = Visibility.Visible;
                        editable = false;
                        updateDescription();
                    }
                }
                else if (sender.Equals(saveButton))
                {
                    if (!discussion.saved)
                    {
                        // Create a new instance with the same attributes
                        Discussion copyOfDiscussion = new Discussion(discussion.discussionId, discussion.user, discussion.title, discussion.description, discussion.numReplies);
                        copyOfDiscussion.score    = discussion.score;
                        copyOfDiscussion.main     = discussion.main;
                        copyOfDiscussion.comments = discussion.comments;

                        // Set the saved flag of the new Discussion to true
                        copyOfDiscussion.Saved = true;
                        //  Pass it to SavedPage.AddPost()
                        main.currSavedPage.AddPost(copyOfDiscussion);

                        // Set the Saved button content of this discussion to Unsave
                        // Set the saved flag of this dicussion to true
                        discussion.saved = true;
                        discussion.saveDiscussion.Content = "Unsave";
                        saveButton.Content = "Unsave";
                    }
                    else if (discussion.saved)
                    {
                        discussion.saved = false;

                        main.currSavedPage.RemovePost(discussion);
                        main.currDiscussionPage.SetDiscussionUnsaved(discussion);
                        discussion.saveDiscussion.Content = "Save";
                        saveButton.Content = "Save";
                    }
                }
                else if (sender.Equals(MessageUserButton))
                {
                    MessageDevelopmentPrompt prompt = new MessageDevelopmentPrompt(this);
                    prompt.ShowDialog();
                }
            }
            else if (!main.signedIn)
            {
                if (sender.Equals(saveButton))
                {
                    NoBlurPrompt prompt = new NoBlurPrompt(main, this);
                    prompt.SetMessage("You must sign in to save posts.");
                    prompt.ShowDialog();
                    main.HighlightTab();
                }
                else
                {
                    NoBlurPrompt prompt = new NoBlurPrompt(main, this);
                    prompt.SetMessage("You must sign in to discuss with users.");
                    prompt.ShowDialog();
                    main.HighlightTab();
                }
            }
        }
Ejemplo n.º 11
0
 protected override void VisitCommentStartBox(CommentBox commentStartBox)
 {
     TryAddElementToCollection(commentStartBox, ContentDisplayAction.Select, false);
     base.VisitCommentStartBox(commentStartBox);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// pinglun
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonComment_Click(object sender, EventArgs e)
        {
            CommentBox box = new CommentBox();

            box.Show();
        }
 protected override void VisitCommentStartBox(CommentBox commentStartBox)
 {
     AddTreeNode(commentStartBox, ContentDisplayAction.Select);
     base.VisitCommentStartBox(commentStartBox);
 }
Ejemplo n.º 14
0
        private void InitializeApplicationBar()
        {
            _refresh = new ApplicationBarIconButton(new Uri("Assets/Appbar/appbar.refresh.png", UriKind.Relative))
            {
                Text = AppResources.ApplicationBar_Refresh
            };
            _refresh.Click += async(sender, e) => await _viewModel.Update();

            _watch = new ApplicationBarIconButton(new Uri("Assets/Appbar/appbar.eye.png", UriKind.Relative))
            {
                Text = AppResources.ApplicationBar_Watch
            };
            _watch.Click += (sender, e) =>
            {
                _viewModel.ToggleWatchlisted();
                UpdateWatchButton();
            };

            _reply = new ApplicationBarIconButton(new Uri("Assets/Appbar/appbar.reply.png", UriKind.Relative))
            {
                Text = AppResources.ApplicationBar_Reply
            };
            _reply.Click += (sender, e) => _viewModel.OpenReplyRegion();

            _send = new ApplicationBarIconButton(new Uri("Assets/Appbar/appbar.send.png", UriKind.Relative))
            {
                Text = AppResources.ApplicationBar_Send
            };
            _send.Click += async(sender, e) =>
            {
                _send.IsEnabled = false;
                Focus();
                ReplyPageViewModelBase.SubmitResultType result = await _viewModel.Submit();

                _send.IsEnabled = true;

                switch (result)
                {
                case ReplyPageViewModelBase.SubmitResultType.Success:
                    ScrollToBottom();
                    break;

                case ReplyPageViewModelBase.SubmitResultType.EmptyCaptchaError:
                case ReplyPageViewModelBase.SubmitResultType.WrongCatpchaError:
                    Focus();
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        CaptchaTextBox.Focus();
                    });
                    break;

                case ReplyPageViewModelBase.SubmitResultType.EmptyCommentError:
                    CommentBox.Focus();
                    break;

                case ReplyPageViewModelBase.SubmitResultType.KnownError:
                case ReplyPageViewModelBase.SubmitResultType.NoImageError:
                case ReplyPageViewModelBase.SubmitResultType.UnknownError:
                    break;
                }
            };

            _edit = new ApplicationBarIconButton(new Uri("Assets/Appbar/appbar.edit.png", UriKind.Relative))
            {
                Text = AppResources.ApplicationBar_Edit
            };
            _edit.Click += (sender, e) => _viewModel.EditReply();

            ApplicationBarMenuItem bottom = new ApplicationBarMenuItem(AppResources.ApplicationBar_ScrollToBottom);

            bottom.Click += (sender, e) => ScrollToBottom();

            ApplicationBar = new ApplicationBar();
            if (CriticalSettingsManager.Current.EnableManualRefresh)
            {
                ApplicationBar.Buttons.Add(_refresh);
            }
            ApplicationBar.Buttons.Add(_reply);
            ApplicationBar.Buttons.Add(_watch);
            ApplicationBar.MenuItems.Add(bottom);
            ApplicationBar.MenuItems.Add(_orientLock);
        }
Ejemplo n.º 15
0
 public void CustomerServiceCanAdFurherInformation(string comment)
 {
     CommentBox.SendKeys(comment);
     GenericObjects.GoToNextPage();
 }