Beispiel #1
0
        private void rateButton_Click(object sender, EventArgs e)
        {
            rateButton.Text    = @"Rating ...";
            rateButton.Enabled = false;

            try {
                carrierRatingLabel.Text = "" + _embedder.RateCarrier(_carrier, _message) + "%";
            } catch (MessageNameTooBigException) {
                MessageBox.Show(
                    @"Could not rate the carrier since the message file's name is too long!",
                    @"Error!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
            } catch (Exception ex) {
                MessageBox.Show(
                    @"The sysem caught an exception:"
                    + "\nType:        " + ex.GetType().Name
                    + "\nMessage:  " + ex.Message,
                    @"Critical error!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
            }
            rateButton.Text    = @"Rate carrier";
            rateButton.Enabled = true;
        }