Ejemplo n.º 1
0
        /// <summary>
        ///  Send event handler.  This method sends the user bug dataset
        ///  to the Watson Web Service.
        /// </summary>
        /// <param name="sender">Button</param>
        /// <param name="e">Null</param>
        private void Send_Click(object sender, System.EventArgs e)
        {
            if (!textChanged)
            {
                return;
            }

            try
            {
                using (WatsonService service = new WatsonService())
                {
                    errorInformation.Tables["Watson"].Rows[0]["UserComment"] = this.Information.Text;
                    errorInformation.Tables["Watson"].Rows[0]["UserEmail"]   = this.Email.Text;
                    service.Url     = GameConfig.WebRoot + "/watson/watson.asmx";
                    service.Timeout = 20000;
                    service.ReportError(errorInformation);
                }

                MessageBox.Show(this, "Thank you! Your bug/suggestion has been sent to the Terrarium development team successfully.", "Bug Sent");
                this.Close();
            }
            catch (Exception exception)
            {
                // Catch all exceptions because we don't want the user to get into an infinite loop
                // and if the website is down, we'll just throw away the data
                ErrorLog.LogHandledException(exception);
                MessageBox.Show(this, "Sorry! There was a problem sending your bug: " + exception.Message, "Problem sending bug.");
            }
        }