示例#1
0
        /// <summary>
        /// This click event method deals with how the message is formatted then previewed before being saved
        /// </summary>
        private void ConvertButton_Click(object sender, RoutedEventArgs e)
        {
            // Validates the message header
            if (validation.MessageHeaderInputValidation(messageHeaderTxt.Text.Trim()).Equals(false))
            {
                MessageBox.Show("You have entered the header incorrectly.");
                messageHeaderTxt.Focus();
                return;
            }

            // Validates the message body
            if (validation.MessageBodyInputValidation(messageBodyTxt.Text.Trim()).Equals(false))
            {
                MessageBox.Show("You have entered the body incorrectly.");
                messageBodyTxt.Focus();
                return;
            }

            // Enables the 'save button'
            saveButton.IsEnabled = true;

            string text    = validation.Text;
            string header  = validation.Header;
            string subject = validation.Subject;


            processing.MessageProcessing(header, ref text, subject);

            // Splits the text up into different textboxes for the user to preview the information
            // Before saving
            convertedMessageHeaderTxt.Text  = validation.Header;
            convertedMessageSenderTxt.Text  = validation.Sender;
            convertedMessageSubjectTxt.Text = validation.Subject;
            convertedMessageBodyTxt.Text    = text.Trim();
            processedText = text.Trim();
        }