コード例 #1
0
        private void onSendClick(object sender, RoutedEventArgs e)
        {
            if (this.topicComboBox.SelectedItem == null)
            {
                this.noTopicText.Visibility = Visibility.Visible;
                this.topicComboBox.Focus();
                return;
            }

            if (this.messageTextBox.Text == "")
            {
                this.messageTextBox.Focus();
                return;
            }

            if (!Toggl.SendFeedback(
                    this.topicComboBox.Text,
                    this.messageTextBox.Text,
                    this.attachedFileName))
            {
                return;
            }

            MessageBox.Show(this, "Your feedback was sent successfully.", "Thank you!");

            this.reset();
            this.Hide();
        }
コード例 #2
0
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (comboBoxTopic.SelectedIndex == 0)
            {
                topicreminder.Visible = true;
                comboBoxTopic.Focus();
                return;
            }

            if (richTextBoxContents.TextLength == 0)
            {
                richTextBoxContents.Focus();
                return;
            }
            if (!Toggl.SendFeedback(
                    comboBoxTopic.Text,
                    richTextBoxContents.Text,
                    openFileDialog.FileName))
            {
                return;
            }
            try
            {
                MainWindowController.DisableTop();
                MessageBox.Show("Your feedback was sent successfully.", "Thank you!");
            } finally {
                MainWindowController.EnableTop();
            }
            comboBoxTopic.SelectedIndex = 0;
            richTextBoxContents.Clear();
            Close();
        }
コード例 #3
0
        private void onSendClick(object sender, RoutedEventArgs e)
        {
            if (this.topicComboBox.SelectedItem == null)
            {
                this.errorText.Text       = "Please choose a topic!";
                this.errorText.Visibility = Visibility.Visible;

                this.topicComboBox.Focus();
                return;
            }

            if (this.messageTextBox.Text == "")
            {
                this.errorText.Text       = "Please type in your feedback!";
                this.errorText.Visibility = Visibility.Visible;
                this.messageTextBox.Focus();
                return;
            }

            if (!Toggl.SendFeedback(
                    this.topicComboBox.Text,
                    this.messageTextBox.Text,
                    this.attachedFileName))
            {
                this.errorText.Text       = "File upload failed! (check file size)";
                this.errorText.Visibility = Visibility.Visible;
                return;
            }

            MessageBox.Show(this, "Your feedback was sent successfully.", "Thank you!");

            this.reset();
            this.Hide();
        }