private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                FileReaderService fileReaderService = new FileReaderService(_fileName);
                fileReaderService.RegisterFormatReader(new XmlFormatReader());
                fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());

                _emailSender.SendEmail(fileReaderService);

                Output.Text = "Sent using file reader service.";
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
        private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                FileReaderService fileReaderService = new FileReaderService(_fileName);
                fileReaderService.RegisterFormatReader(new XmlFormatReader());
                fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());

                ProcessingService processingService = new ProcessingService(new EmailSender(), fileReaderService);
                string messageSendingStatus = processingService.SendMessage();

                Output.Text = messageSendingStatus;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
        private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                FileReaderService fileReaderService = new FileReaderService(_fileName);
                fileReaderService.RegisterFormatReader(new XmlFormatReader());
                fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());

                ProcessingService processingService    = new ProcessingService(new EmailSender(), fileReaderService);
                string            messageSendingStatus = processingService.SendMessage();

                Output.Text = messageSendingStatus;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
        private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                FileReaderService fileReaderService = new FileReaderService();
                fileReaderService.RegisterFormatReader(new XmlFormatReader());
                fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());
                string messageBody = fileReaderService.GetMessageBodyFromFile(_fileName);

                EmailSender emailSender = new EmailSender();
                emailSender.SendEmail(messageBody);

                Output.Text = "Sent email with body: " + Environment.NewLine + messageBody;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
        private void Send_Click(object sender, EventArgs e)
        {
            try
            {
                Output.Text = string.Empty;

                FileReaderService fileReaderService = new FileReaderService();
                fileReaderService.RegisterFormatReader(new XmlFormatReader());
                fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());
                string messageBody = fileReaderService.GetMessageBodyFromFile(_fileName);

                EmailSender emailSender = new EmailSender();
                emailSender.SendEmail(messageBody);

                Output.Text = "Sent email with body: " + Environment.NewLine + messageBody;
            }
            catch (Exception ex)
            {
                Output.Text = ex.ToString();
            }
        }
 public EmailSender()
 {
     _fileReaderService.RegisterFormatReader(new XmlFormatReader());
     _fileReaderService.RegisterDefaultFormatReader(new FlatFileFormatReader());
 }