// Handles both normal and large message send operations
        private void SendGeneric(bool useLargeMessageSample)
        {
            progressBarReceive.Visibility = Visibility.Hidden;
            Utilities.StartProgressBar(progressBarSend);
            try
            {
                MessageQueueTransaction transaction = new MessageQueueTransaction();
                transaction.Begin();

                IMessageFormatter formatter = new BinaryMessageFormatter();
                Message message = new Message();

                FileInfo fileInfo = new FileInfo(textFileName.Text);
                FileStream fStream = fileInfo.OpenRead();
                byte[] b = new byte[fStream.Length];
                fStream.Read(b, 0, b.Length);
                MemoryStream mStream = new MemoryStream(b, 0, b.Length, false);

                message.Label = fileInfo.Name;
                message.Formatter = formatter;
                message.UseDeadLetterQueue = true;
                message.Body = mStream;

                int fragmentSize = 0;
                if (textFragmentSize.Text.Length != 0)
                {
                    fragmentSize = Int32.Parse(textFragmentSize.Text, CultureInfo.InvariantCulture);
                }

                if (useLargeMessageSample)
                {
                    LargeMessageQueue largeMessageQueue = new LargeMessageQueue(this.queue, fragmentSize);
                    largeMessageQueue.Send(message, transaction);
                }
                else
                {
                    this.queue.Send(message, transaction);
                }

                transaction.Commit();

                Utilities.StopProgressBar(progressBarSend);
                this.SetQueueViewerStatus();

                MessageBox.Show("Send successful!", "Success!");
            }
            catch (Exception ex)
            {
                Utilities.ErrorProgressBar(progressBarSend);
                this.SetQueueViewerStatus();

                MessageBox.Show("Send Error: " + ex.Message, "Error!");
            }
        }